Skip to content

Commit

Permalink
Merge pull request #396 from greg0ire/2.2.x
Browse files Browse the repository at this point in the history
Merge 2.1.x up into 2.2.x
  • Loading branch information
greg0ire authored Feb 25, 2024
2 parents 957e63b + 62b9f08 commit ff6dafb
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 18 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"doctrine/coding-standard": "^12",
"phpstan/phpstan": "^1.8",
"phpstan/phpstan-phpunit": "^1.0",
"phpunit/phpunit": "^9.5",
"phpunit/phpunit": "^10.5",
"vimeo/psalm": "^5.11"
},
"autoload": {
Expand Down
6 changes: 2 additions & 4 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>

<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
colors="true"
verbose="true"
beStrictAboutOutputDuringTests="true"
beStrictAboutTodoAnnotatedTests="true"
>
Expand All @@ -13,9 +11,9 @@
</testsuite>
</testsuites>

<coverage>
<source>
<include>
<directory>./src/</directory>
</include>
</coverage>
</source>
</phpunit>
6 changes: 3 additions & 3 deletions src/ReadableCollection.php
Original file line number Diff line number Diff line change
Expand Up @@ -229,11 +229,11 @@ public function findFirst(Closure $p);
* Applies iteratively the given function to each element in the collection,
* so as to reduce the collection to a single value.
*
* @psalm-param Closure(TReturn|TInitial|null, T):(TInitial|TReturn) $func
* @psalm-param TInitial|null $initial
* @psalm-param Closure(TReturn|TInitial, T):TReturn $func
* @psalm-param TInitial $initial
*
* @return mixed
* @psalm-return TReturn|TInitial|null
* @psalm-return TReturn|TInitial
*
* @psalm-template TReturn
* @psalm-template TInitial
Expand Down
2 changes: 1 addition & 1 deletion tests/AbstractLazyArrayCollectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*
* @covers \Doctrine\Common\Collections\AbstractLazyCollection
*/
class AbstractLazyArrayCollectionTest extends BaseArrayCollectionTest
class AbstractLazyArrayCollectionTest extends ArrayCollectionTestCase
{
/**
* @param mixed[] $elements
Expand Down
2 changes: 1 addition & 1 deletion tests/AbstractLazyCollectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
* @covers \Doctrine\Common\Collections\AbstractLazyCollection
*/
class AbstractLazyCollectionTest extends BaseCollectionTest
class AbstractLazyCollectionTest extends CollectionTestCase
{
protected function setUp(): void
{
Expand Down
2 changes: 1 addition & 1 deletion tests/ArrayCollectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*
* @covers \Doctrine\Common\Collections\ArrayCollection
*/
class ArrayCollectionTest extends BaseArrayCollectionTest
class ArrayCollectionTest extends ArrayCollectionTestCase
{
/**
* @param mixed[] $elements
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
use function next;
use function reset;

abstract class BaseArrayCollectionTest extends TestCase
abstract class ArrayCollectionTestCase extends TestCase
{
/**
* @param mixed[] $elements
Expand Down Expand Up @@ -184,7 +184,7 @@ public function testIterator(array $elements): void
}

/** @psalm-return array<string, array{mixed[]}> */
public function provideDifferentElements(): array
public static function provideDifferentElements(): array
{
return [
'indexed' => [[1, 2, 3, 4, 5]],
Expand Down Expand Up @@ -369,7 +369,7 @@ public function testMatchingWithSlicingPreserveKeys(array $array, array $slicedA
}

/** @return mixed[][] */
public function provideSlices(): array
public static function provideSlices(): array
{
return [
'preserve numeric keys' => [
Expand Down
2 changes: 1 addition & 1 deletion tests/CollectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
use function count;
use function is_string;

class CollectionTest extends BaseCollectionTest
class CollectionTest extends CollectionTestCase
{
protected function setUp(): void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
use function is_string;
use function sprintf;

abstract class BaseCollectionTest extends TestCase
abstract class CollectionTestCase extends TestCase
{
/** @var Collection<mixed> */
protected Collection $collection;
Expand Down
10 changes: 8 additions & 2 deletions tests/Expr/CompositeExpressionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,18 @@
class CompositeExpressionTest extends TestCase
{
/** @return list<array{type:string, expressions: list<mixed>}> */
public function invalidDataProvider(): array
public static function invalidDataProvider(): array
{
return [
['type' => CompositeExpression::TYPE_AND, 'expressions' => [new Value('value')]],
['type' => CompositeExpression::TYPE_AND, 'expressions' => ['wrong-type']],
['type' => CompositeExpression::TYPE_NOT, 'expressions' => [$this->createMock(Expression::class), $this->createMock(Expression::class)]],
[
'type' => CompositeExpression::TYPE_NOT,
'expressions' => [
self::createStub(Expression::class),
self::createStub(Expression::class),
],
],
];
}

Expand Down

0 comments on commit ff6dafb

Please sign in to comment.