Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tools/.phpstan/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"phpstan/extension-installer": "^1.4.3",
"phpstan/phpstan-phpunit": "^2.1.1",
"phpstan/phpstan-strict-rules": "^2.1.0",
"ergebnis/phpstan-rules": "^2.14.0"
"ergebnis/phpstan-rules": "^2.14.2"
},
"config": {
"allow-plugins": {
Expand Down
26 changes: 13 additions & 13 deletions tools/.phpstan/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 13 additions & 13 deletions tools/.phpstan/vendor/composer/installed.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
"packages": [
{
"name": "ergebnis/phpstan-rules",
"version": "2.14.0",
"version_normalized": "2.14.0.0",
"version": "2.14.2",
"version_normalized": "2.14.2.0",
"source": {
"type": "git",
"url": "https://github.com/ergebnis/phpstan-rules.git",
"reference": "04fac7195113fd33d35c01060cc09e03542494d5"
"reference": "a8d8695a4197b79f74e1ed1353ef52c41578c0ab"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/ergebnis/phpstan-rules/zipball/04fac7195113fd33d35c01060cc09e03542494d5",
"reference": "04fac7195113fd33d35c01060cc09e03542494d5",
"url": "https://api.github.com/repos/ergebnis/phpstan-rules/zipball/a8d8695a4197b79f74e1ed1353ef52c41578c0ab",
"reference": "a8d8695a4197b79f74e1ed1353ef52c41578c0ab",
"shasum": ""
},
"require": {
Expand All @@ -23,23 +23,23 @@
"require-dev": {
"codeception/codeception": "^4.0.0 || ^5.0.0",
"doctrine/orm": "^2.20.0 || ^3.3.0",
"ergebnis/composer-normalize": "^2.53.0",
"ergebnis/license": "^2.7.0",
"ergebnis/php-cs-fixer-config": "^6.63.2",
"ergebnis/phpunit-slow-test-detector": "^2.25.0",
"ergebnis/rector-rules": "^1.18.3",
"ergebnis/composer-normalize": "^2.54.0",
"ergebnis/license": "^2.8.0",
"ergebnis/php-cs-fixer-config": "^6.64.1",
"ergebnis/phpunit-slow-test-detector": "^2.26.0",
"ergebnis/rector-rules": "^1.18.5",
"fakerphp/faker": "^1.24.1",
"phpstan/extension-installer": "^1.4.3",
"phpstan/phpstan-deprecation-rules": "^2.0.5",
"phpstan/phpstan-phpunit": "^2.0.18",
"phpstan/phpstan-strict-rules": "^2.0.12",
"phpstan/phpstan-phpunit": "^2.0.21",
"phpstan/phpstan-strict-rules": "^2.1.0",
"phpunit/phpunit": "^9.6.33",
"psr/container": "^2.0.2",
"rector/rector": "^2.3.8",
"symfony/finder": "^5.4.45",
"symfony/process": "^5.4.51"
},
"time": "2026-09-24T19:43:19+00:00",
"time": "2026-10-16T14:36:23+00:00",
"type": "phpstan-extension",
"extra": {
"phpstan": {
Expand Down
10 changes: 5 additions & 5 deletions tools/.phpstan/vendor/composer/installed.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
'name' => '__root__',
'pretty_version' => 'dev-main',
'version' => 'dev-main',
'reference' => '82ec82e0eccc363c18da38370e705984c9fc9253',
'reference' => '443da4d6af023f04023fcfeb1dd87020381e9b0c',
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
Expand All @@ -13,16 +13,16 @@
'__root__' => array(
'pretty_version' => 'dev-main',
'version' => 'dev-main',
'reference' => '82ec82e0eccc363c18da38370e705984c9fc9253',
'reference' => '443da4d6af023f04023fcfeb1dd87020381e9b0c',
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
'dev_requirement' => false,
),
'ergebnis/phpstan-rules' => array(
'pretty_version' => '2.14.0',
'version' => '2.14.0.0',
'reference' => '04fac7195113fd33d35c01060cc09e03542494d5',
'pretty_version' => '2.14.2',
'version' => '2.14.2.0',
'reference' => 'a8d8695a4197b79f74e1ed1353ef52c41578c0ab',
'type' => 'phpstan-extension',
'install_path' => __DIR__ . '/../ergebnis/phpstan-rules',
'aliases' => array(),
Expand Down
27 changes: 25 additions & 2 deletions tools/.phpstan/vendor/ergebnis/phpstan-rules/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,23 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## Unreleased

For a full diff see [`2.14.0...main`][2.14.0...main].
For a full diff see [`2.14.2...main`][2.14.2...main].

## [`2.14.2`][2.14.2]

For a full diff see [`2.14.1...2.14.2`][2.14.1...2.14.2].

### Fixed

- Adjusted `rules.neon` to register `Closures\NoParameterWithNullDefaultValueRule` ([#1140]), by [@alfredbez]

## [`2.14.1`][2.14.1]

For a full diff see [`2.14.0...2.14.1`][2.14.0...2.14.1].

### Fixed

- Adjusted `Methods\InvokeParentHookMethodRule` to detect the invocation of a parent hook method in a `finally` block ([#1139]), by [@localheinz]

## [`2.14.0`][2.14.0]

Expand Down Expand Up @@ -676,7 +692,11 @@ For a full diff see [`362c7ea...0.1.0`][362c7ea...0.1.0].
[2.13.0...2.13.1]: https://github.com/ergebnis/phpstan-rules/compare/2.13.0...2.13.1
[2.13.1...2.14.0]: https://github.com/ergebnis/phpstan-rules/compare/2.13.1...2.14.0
[2.14.0]: https://github.com/ergebnis/phpstan-rules/releases/tag/2.14.0
[2.14.0...main]: https://github.com/ergebnis/phpstan-rules/compare/2.14.0...main
[2.14.0...2.14.1]: https://github.com/ergebnis/phpstan-rules/compare/2.14.0...2.14.1
[2.14.1]: https://github.com/ergebnis/phpstan-rules/releases/tag/2.14.1
[2.14.1...2.14.2]: https://github.com/ergebnis/phpstan-rules/compare/2.14.1...2.14.2
[2.14.2]: https://github.com/ergebnis/phpstan-rules/releases/tag/2.14.2
[2.14.2...main]: https://github.com/ergebnis/phpstan-rules/compare/2.14.2...main

[#1]: https://github.com/ergebnis/phpstan-rules/pull/1
[#4]: https://github.com/ergebnis/phpstan-rules/pull/4
Expand Down Expand Up @@ -780,7 +800,10 @@ For a full diff see [`362c7ea...0.1.0`][362c7ea...0.1.0].
[#1011]: https://github.com/ergebnis/phpstan-rules/pull/1011
[#1036]: https://github.com/ergebnis/phpstan-rules/pull/1036
[#1101]: https://github.com/ergebnis/phpstan-rules/pull/1101
[#1139]: https://github.com/ergebnis/phpstan-rules/pull/1139
[#1140]: https://github.com/ergebnis/phpstan-rules/pull/1140

[@alfredbez]: https://github.com/alfredbez
[@cosmastech]: https://github.com/cosmastech
[@dmecke]: https://github.com/dmecke
[@enumag]: https://github.com/enumag
Expand Down
4 changes: 1 addition & 3 deletions tools/.phpstan/vendor/ergebnis/phpstan-rules/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -751,8 +751,6 @@ The maintainers of this project ask contributors to follow the [code of conduct]

The maintainers of this project provide limited support.

You can support the maintenance of this project by [sponsoring @ergebnis](https://github.com/sponsors/ergebnis).

## PHP Version Support Policy

This project currently supports the following PHP versions:
Expand Down Expand Up @@ -781,4 +779,4 @@ The method [`FinalRule::isWhitelistedClass()`](src/Classes/FinalRule.php) is ins

## Social

Follow [@localheinz](https://twitter.com/intent/follow?screen_name=localheinz) and [@ergebnis](https://twitter.com/intent/follow?screen_name=ergebnis) on Twitter.
Follow [@localheinz](https://x.com/intent/follow?screen_name=localheinz) and [@ergebnis](https://x.com/intent/follow?screen_name=ergebnis) on X.
14 changes: 7 additions & 7 deletions tools/.phpstan/vendor/ergebnis/phpstan-rules/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@
"require-dev": {
"codeception/codeception": "^4.0.0 || ^5.0.0",
"doctrine/orm": "^2.20.0 || ^3.3.0",
"ergebnis/composer-normalize": "^2.53.0",
"ergebnis/license": "^2.7.0",
"ergebnis/php-cs-fixer-config": "^6.63.2",
"ergebnis/phpunit-slow-test-detector": "^2.25.0",
"ergebnis/rector-rules": "^1.18.3",
"ergebnis/composer-normalize": "^2.54.0",
"ergebnis/license": "^2.8.0",
"ergebnis/php-cs-fixer-config": "^6.64.1",
"ergebnis/phpunit-slow-test-detector": "^2.26.0",
"ergebnis/rector-rules": "^1.18.5",
"fakerphp/faker": "^1.24.1",
"phpstan/extension-installer": "^1.4.3",
"phpstan/phpstan-deprecation-rules": "^2.0.5",
"phpstan/phpstan-phpunit": "^2.0.18",
"phpstan/phpstan-strict-rules": "^2.0.12",
"phpstan/phpstan-phpunit": "^2.0.21",
"phpstan/phpstan-strict-rules": "^2.1.0",
"phpunit/phpunit": "^9.6.33",
"psr/container": "^2.0.2",
"rector/rector": "^2.3.8",
Expand Down
5 changes: 5 additions & 0 deletions tools/.phpstan/vendor/ergebnis/phpstan-rules/rules.neon
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ conditionalTags:
phpstan.rules.rule: %ergebnis.noParameterPassedByReference.enabled%
Ergebnis\PHPStan\Rules\Closures\NoParameterWithNullableTypeDeclarationRule:
phpstan.rules.rule: %ergebnis.noParameterWithNullableTypeDeclaration.enabled%
Ergebnis\PHPStan\Rules\Closures\NoParameterWithNullDefaultValueRule:
phpstan.rules.rule: %ergebnis.noParameterWithNullDefaultValue.enabled%
Ergebnis\PHPStan\Rules\Expressions\NoAssignByReferenceRule:
phpstan.rules.rule: %ergebnis.noAssignByReference.enabled%
Ergebnis\PHPStan\Rules\Expressions\NoCompactRule:
Expand Down Expand Up @@ -227,6 +229,9 @@ services:
-
class: Ergebnis\PHPStan\Rules\Closures\NoParameterWithNullableTypeDeclarationRule

-
class: Ergebnis\PHPStan\Rules\Closures\NoParameterWithNullDefaultValueRule

-
class: Ergebnis\PHPStan\Rules\Expressions\NoAssignByReferenceRule

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,46 +223,79 @@ private static function findParentHookMethodInvocation(
$statementCount = \count($statementsWithOperations);

foreach ($statementsWithOperations as $index => $statement) {
if (!$statement instanceof Node\Stmt\Expression) {
continue;
}
if ($statement instanceof Node\Stmt\TryCatch) {
if (!$statement->finally instanceof Node\Stmt\Finally_) {
continue;
}

if (!$statement->expr instanceof Node\Expr\StaticCall) {
continue;
$finallyInvocation = self::findParentHookMethodInvocation(
\array_values($statement->finally->stmts),
$hookMethod,
);

if ($finallyInvocation->equals(Invocation::never())) {
continue;
}

if (
$finallyInvocation->equals(Invocation::last())
&& $statementCount - 1 === $index
) {
return Invocation::last();
}

return Invocation::any();
}

if (!$statement->expr->class instanceof Node\Name) {
if (!self::isParentHookMethodInvocation($statement, $hookMethod)) {
continue;
}

$className = (string) $statement->expr->class;
if (1 === $statementCount) {
return $hookMethod->invocation();
}

if (\mb_strtolower($className) !== 'parent') {
continue;
if (0 === $index) {
return Invocation::first();
}

if (!$statement->expr->name instanceof Node\Identifier) {
continue;
if ($statementCount - 1 === $index) {
return Invocation::last();
}

if (\mb_strtolower($statement->expr->name->toString()) === \mb_strtolower($hookMethod->methodName()->toString())) {
if (1 === $statementCount) {
return $hookMethod->invocation();
}
return Invocation::any();
}

if (0 === $index) {
return Invocation::first();
}
return Invocation::never();
}

if ($statementCount - 1 === $index) {
return Invocation::last();
}
private static function isParentHookMethodInvocation(
Node\Stmt $statement,
HookMethod $hookMethod
): bool {
if (!$statement instanceof Node\Stmt\Expression) {
return false;
}

return Invocation::any();
}
if (!$statement->expr instanceof Node\Expr\StaticCall) {
return false;
}

return Invocation::never();
if (!$statement->expr->class instanceof Node\Name) {
return false;
}

$className = (string) $statement->expr->class;

if (\mb_strtolower($className) !== 'parent') {
return false;
}

if (!$statement->expr->name instanceof Node\Identifier) {
return false;
}

return \mb_strtolower($statement->expr->name->toString()) === \mb_strtolower($hookMethod->methodName()->toString());
}

/**
Expand Down
Loading