diff --git a/.github/workflows/rector.yml b/.github/workflows/rector.yml index 35411d0a..457772af 100644 --- a/.github/workflows/rector.yml +++ b/.github/workflows/rector.yml @@ -1,5 +1,5 @@ on: - pull_request: + pull_request_target: paths-ignore: - 'docs/**' - 'README.md' @@ -17,6 +17,7 @@ jobs: secrets: token: ${{ secrets.YIISOFT_GITHUB_TOKEN }} with: + repository: ${{ github.event.pull_request.head.repo.full_name }} os: >- ['ubuntu-latest'] php: >- diff --git a/composer.json b/composer.json index 8537a5c3..a6d2a54b 100644 --- a/composer.json +++ b/composer.json @@ -55,10 +55,10 @@ "maglnet/composer-require-checker": "^4.2", "nyholm/psr7": "^1.3", "phpunit/phpunit": "^10.5", - "rector/rector": "^1.0.0", + "rector/rector": "^1.2", "roave/infection-static-analysis-plugin": "^1.16", "spatie/phpunit-watcher": "^1.23", - "vimeo/psalm": "^5.25", + "vimeo/psalm": "^5.26", "yiisoft/error-handler": "^3.0", "yiisoft/event-dispatcher": "^1.0", "yiisoft/log": "^2.0", diff --git a/rector.php b/rector.php index 5548304b..582cc4ad 100644 --- a/rector.php +++ b/rector.php @@ -17,7 +17,7 @@ // define sets of rules $rectorConfig->sets([ - LevelSetList::UP_TO_PHP_80, + LevelSetList::UP_TO_PHP_81, ]); $rectorConfig->skip([ diff --git a/src/Dumper.php b/src/Dumper.php index 0fdaee87..e76b1aca 100644 --- a/src/Dumper.php +++ b/src/Dumper.php @@ -14,7 +14,7 @@ final class Dumper private array $objects = []; private static ?ClosureExporter $closureExporter = null; - private array $excludedClasses; + private readonly array $excludedClasses; private function __construct( private readonly mixed $variable, diff --git a/src/FlattenException.php b/src/FlattenException.php index 3e63a533..3e6ab1c6 100644 --- a/src/FlattenException.php +++ b/src/FlattenException.php @@ -163,6 +163,17 @@ public function getTrace(): array /** * @param array $trace the Exception stack trace as an array. + * + * @psalm-param list< + * array{ + * args?: array, + * class?: class-string, + * file?: string, + * function?: string, + * line?: int, + * type?: string + * } + * > $trace */ private function setTrace(array $trace): void { diff --git a/tests/Support/Stub/BrokenProxyImplementation.php b/tests/Support/Stub/BrokenProxyImplementation.php index e1490f46..526bebd2 100644 --- a/tests/Support/Stub/BrokenProxyImplementation.php +++ b/tests/Support/Stub/BrokenProxyImplementation.php @@ -8,7 +8,7 @@ class BrokenProxyImplementation implements Interface1 { - public function __construct(private Interface1 $decorated) + public function __construct(private readonly Interface1 $decorated) { throw new Exception('Broken proxy'); } diff --git a/tests/Unit/FlattenExceptionTest.php b/tests/Unit/FlattenExceptionTest.php index 63329ec2..aa852442 100644 --- a/tests/Unit/FlattenExceptionTest.php +++ b/tests/Unit/FlattenExceptionTest.php @@ -78,7 +78,7 @@ public function testClass(): void $this->assertEquals('Exception', (new FlattenException(new Exception()))->getClass()); } - public function testArguments(): void + public function testArguments(): never { $this->markTestSkipped('Should be fixed'); @@ -151,7 +151,7 @@ public function testClosureSerialize(): void $this->assertStringContainsString(Closure::class, serialize($flattened)); } - public function testRecursionInArguments(): void + public function testRecursionInArguments(): never { $this->markTestSkipped('Should be fixed'); @@ -164,7 +164,7 @@ public function testRecursionInArguments(): void $this->assertStringContainsString('*DEEP NESTED ARRAY*', serialize($trace)); } - public function testTooBigArray(): void + public function testTooBigArray(): never { $this->markTestSkipped('Should be fixed');