Skip to content

Commit 86a1df5

Browse files
committed
Update dev dependencies
1 parent c3f3e44 commit 86a1df5

13 files changed

+314
-337
lines changed

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818
"require-dev": {
1919
"ext-tokenizer": "*",
2020
"phpunit/phpunit": "^9.5",
21-
"phpstan/phpstan": "^1.8",
22-
"phpstan/phpstan-phpunit": "^1.1",
23-
"phpstan/extension-installer": "^1.1",
24-
"rector/rector": "^0.13.9",
21+
"phpstan/phpstan": "^2.1",
22+
"phpstan/phpstan-phpunit": "^2.0",
23+
"phpstan/extension-installer": "^1.4",
24+
"rector/rector": "^2.2",
2525
"phpbench/phpbench": "^1.2",
2626
"psalm/phar": "^4"
2727
},

composer.lock

Lines changed: 272 additions & 260 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

phpstan.neon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,6 @@ parameters:
3333
path: tests/unit/Types/CompoundTest.php
3434

3535
-
36-
message: "#^Parameter \\#1 \\$argument of class ReflectionClass constructor expects class\\-string\\<Foo\\\\Bar\\>\\|Foo\\\\Bar\\, string given\\.$#"
36+
message: "#^Parameter \\#1 \\$objectOrClass of class ReflectionClass constructor expects class\\-string\\<Foo\\\\Bar\\>\\|Foo\\\\Bar\\, string given\\.$#"
3737
count: 1
3838
path: tests/unit/Types/ContextFactoryTest.php

rector.php

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,24 @@
22

33
declare(strict_types=1);
44

5+
use Rector\CodeQuality\Rector\Class_\CompleteDynamicPropertiesRector;
56
use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector;
67
use Rector\Config\RectorConfig;
7-
use Rector\Set\ValueObject\DowngradeLevelSetList;
8-
use Rector\Set\ValueObject\LevelSetList;
8+
use Rector\TypeDeclaration\Rector\Closure\ClosureReturnTypeRector;
9+
use Rector\ValueObject\PhpVersion;
910

10-
return static function (RectorConfig $rectorConfig): void {
11-
$rectorConfig->paths([
11+
return RectorConfig::configure()
12+
->withPaths([
1213
__DIR__ . '/src',
13-
__DIR__ . '/tests/unit'
14+
__DIR__ . '/tests/unit',
15+
])
16+
->withImportNames()
17+
->withPhpVersion(PhpVersion::PHP_74)
18+
->withPHPStanConfigs([
19+
__DIR__ . '/phpstan.neon',
20+
])
21+
->withRules([
22+
InlineConstructorDefaultToPropertyRector::class,
23+
CompleteDynamicPropertiesRector::class,
24+
ClosureReturnTypeRector::class,
1425
]);
15-
16-
// register a single rule
17-
$rectorConfig->rule(InlineConstructorDefaultToPropertyRector::class);
18-
$rectorConfig->rule(Rector\CodeQuality\Rector\Class_\CompleteDynamicPropertiesRector::class);
19-
$rectorConfig->rule(Rector\TypeDeclaration\Rector\Closure\AddClosureReturnTypeRector::class);
20-
$rectorConfig->rule(Rector\PHPUnit\Rector\Class_\AddProphecyTraitRector::class);
21-
$rectorConfig->importNames();
22-
23-
// define sets of rules
24-
$rectorConfig->sets([
25-
DowngradeLevelSetList::DOWN_TO_PHP_73
26-
]);
27-
};

src/TypeResolver.php

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -324,18 +324,16 @@ function (ObjectShapeItemNode $item) use ($context): ObjectShapeItem {
324324

325325
case IntersectionTypeNode::class:
326326
return new Intersection(
327-
array_filter(
328-
array_map(
329-
function (TypeNode $nestedType) use ($context): Type {
330-
$type = $this->createType($nestedType, $context);
331-
if ($type instanceof AggregatedType) {
332-
return new Expression($type);
333-
}
334-
335-
return $type;
336-
},
337-
$type->types
338-
)
327+
array_map(
328+
function (TypeNode $nestedType) use ($context): Type {
329+
$type = $this->createType($nestedType, $context);
330+
if ($type instanceof AggregatedType) {
331+
return new Expression($type);
332+
}
333+
334+
return $type;
335+
},
336+
$type->types
339337
)
340338
);
341339

@@ -346,18 +344,16 @@ function (TypeNode $nestedType) use ($context): Type {
346344

347345
case UnionTypeNode::class:
348346
return new Compound(
349-
array_filter(
350-
array_map(
351-
function (TypeNode $nestedType) use ($context): Type {
352-
$type = $this->createType($nestedType, $context);
353-
if ($type instanceof AggregatedType) {
354-
return new Expression($type);
355-
}
356-
357-
return $type;
358-
},
359-
$type->types
360-
)
347+
array_map(
348+
function (TypeNode $nestedType) use ($context): Type {
349+
$type = $this->createType($nestedType, $context);
350+
if ($type instanceof AggregatedType) {
351+
return new Expression($type);
352+
}
353+
354+
return $type;
355+
},
356+
$type->types
361357
)
362358
);
363359

tests/unit/CollectionResolverTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
use RuntimeException;
3030

3131
/**
32-
* @covers ::<private>
3332
* @coversDefaultClass \phpDocumentor\Reflection\TypeResolver
3433
*/
3534
class CollectionResolverTest extends TestCase
@@ -187,7 +186,7 @@ public function testResolvingCollectionOfCollection(): void
187186
$this->assertArrayHasKey(0, $types);
188187
$this->assertEquals(new Compound([new String_(), new Integer(), new Float_()]), $types[0]);
189188

190-
$this->assertArrayHasKey(0, $types);
189+
$this->assertArrayHasKey(1, $types);
191190
$this->assertInstanceOf(Generic::class, $types[1]);
192191
$this->assertSame('\\ArrayObject', (string) $types[1]->getFqsen());
193192

tests/unit/FqsenResolverTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919

2020
/**
2121
* @coversDefaultClass \phpDocumentor\Reflection\FqsenResolver
22-
* @covers ::<private>
2322
*/
2423
final class FqsenResolverTest extends TestCase
2524
{

tests/unit/IntegerRangeResolverTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
use RuntimeException;
2020

2121
/**
22-
* @covers ::<private>
2322
* @coversDefaultClass \phpDocumentor\Reflection\TypeResolver
2423
*/
2524
class IntegerRangeResolverTest extends TestCase

tests/unit/NumericResolverTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
use PHPUnit\Framework\TestCase;
2222

2323
/**
24-
* @covers ::<private>
2524
* @coversDefaultClass \phpDocumentor\Reflection\TypeResolver
2625
*/
2726
class NumericResolverTest extends TestCase

tests/unit/PseudoTypes/FalseTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,5 @@ public function testCanBeInstantiatedUsingDeprecatedFqsen(): void
4949
$false = new \phpDocumentor\Reflection\Types\False_();
5050

5151
$this->assertSame('false', (string) $false);
52-
$this->assertInstanceOf(False_::class, $false);
53-
$this->assertInstanceOf(\phpDocumentor\Reflection\Types\False_::class, $false);
5452
}
5553
}

0 commit comments

Comments
 (0)