Skip to content

Commit cabe755

Browse files
committed
Update dependency ergebnis/phpstan-rules to ^2.14.2
1 parent f671a12 commit cabe755

9 files changed

Lines changed: 127 additions & 68 deletions

File tree

‎tools/.phpstan/composer.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"phpstan/phpstan": "^2.3.1",
44
"phpstan/extension-installer": "^1.4.3",
55
"phpstan/phpstan-strict-rules": "^2.1.0",
6-
"ergebnis/phpstan-rules": "^2.14.0"
6+
"ergebnis/phpstan-rules": "^2.14.2"
77
},
88
"config": {
99
"allow-plugins": {

‎tools/.phpstan/composer.lock‎

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

‎tools/.phpstan/vendor/composer/installed.json‎

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22
"packages": [
33
{
44
"name": "ergebnis/phpstan-rules",
5-
"version": "2.14.0",
6-
"version_normalized": "2.14.0.0",
5+
"version": "2.14.2",
6+
"version_normalized": "2.14.2.0",
77
"source": {
88
"type": "git",
99
"url": "https://github.com/ergebnis/phpstan-rules.git",
10-
"reference": "04fac7195113fd33d35c01060cc09e03542494d5"
10+
"reference": "a8d8695a4197b79f74e1ed1353ef52c41578c0ab"
1111
},
1212
"dist": {
1313
"type": "zip",
14-
"url": "https://api.github.com/repos/ergebnis/phpstan-rules/zipball/04fac7195113fd33d35c01060cc09e03542494d5",
15-
"reference": "04fac7195113fd33d35c01060cc09e03542494d5",
14+
"url": "https://api.github.com/repos/ergebnis/phpstan-rules/zipball/a8d8695a4197b79f74e1ed1353ef52c41578c0ab",
15+
"reference": "a8d8695a4197b79f74e1ed1353ef52c41578c0ab",
1616
"shasum": ""
1717
},
1818
"require": {
@@ -23,23 +23,23 @@
2323
"require-dev": {
2424
"codeception/codeception": "^4.0.0 || ^5.0.0",
2525
"doctrine/orm": "^2.20.0 || ^3.3.0",
26-
"ergebnis/composer-normalize": "^2.53.0",
27-
"ergebnis/license": "^2.7.0",
28-
"ergebnis/php-cs-fixer-config": "^6.63.2",
29-
"ergebnis/phpunit-slow-test-detector": "^2.25.0",
30-
"ergebnis/rector-rules": "^1.18.3",
26+
"ergebnis/composer-normalize": "^2.54.0",
27+
"ergebnis/license": "^2.8.0",
28+
"ergebnis/php-cs-fixer-config": "^6.64.1",
29+
"ergebnis/phpunit-slow-test-detector": "^2.26.0",
30+
"ergebnis/rector-rules": "^1.18.5",
3131
"fakerphp/faker": "^1.24.1",
3232
"phpstan/extension-installer": "^1.4.3",
3333
"phpstan/phpstan-deprecation-rules": "^2.0.5",
34-
"phpstan/phpstan-phpunit": "^2.0.18",
35-
"phpstan/phpstan-strict-rules": "^2.0.12",
34+
"phpstan/phpstan-phpunit": "^2.0.21",
35+
"phpstan/phpstan-strict-rules": "^2.1.0",
3636
"phpunit/phpunit": "^9.6.33",
3737
"psr/container": "^2.0.2",
3838
"rector/rector": "^2.3.8",
3939
"symfony/finder": "^5.4.45",
4040
"symfony/process": "^5.4.51"
4141
},
42-
"time": "2026-09-24T19:43:19+00:00",
42+
"time": "2026-10-16T14:36:23+00:00",
4343
"type": "phpstan-extension",
4444
"extra": {
4545
"phpstan": {

‎tools/.phpstan/vendor/composer/installed.php‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
'name' => '__root__',
44
'pretty_version' => '7.0.x-dev',
55
'version' => '7.0.9999999.9999999-dev',
6-
'reference' => '9228b5810dabb95a557be754eae873c5b5b1ef0f',
6+
'reference' => 'f671a12b84af3bb66c5c4d4243ff08c1fa528e84',
77
'type' => 'library',
88
'install_path' => __DIR__ . '/../../',
99
'aliases' => array(),
@@ -13,16 +13,16 @@
1313
'__root__' => array(
1414
'pretty_version' => '7.0.x-dev',
1515
'version' => '7.0.9999999.9999999-dev',
16-
'reference' => '9228b5810dabb95a557be754eae873c5b5b1ef0f',
16+
'reference' => 'f671a12b84af3bb66c5c4d4243ff08c1fa528e84',
1717
'type' => 'library',
1818
'install_path' => __DIR__ . '/../../',
1919
'aliases' => array(),
2020
'dev_requirement' => false,
2121
),
2222
'ergebnis/phpstan-rules' => array(
23-
'pretty_version' => '2.14.0',
24-
'version' => '2.14.0.0',
25-
'reference' => '04fac7195113fd33d35c01060cc09e03542494d5',
23+
'pretty_version' => '2.14.2',
24+
'version' => '2.14.2.0',
25+
'reference' => 'a8d8695a4197b79f74e1ed1353ef52c41578c0ab',
2626
'type' => 'phpstan-extension',
2727
'install_path' => __DIR__ . '/../ergebnis/phpstan-rules',
2828
'aliases' => array(),

‎tools/.phpstan/vendor/ergebnis/phpstan-rules/CHANGELOG.md‎

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,23 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66

77
## Unreleased
88

9-
For a full diff see [`2.14.0...main`][2.14.0...main].
9+
For a full diff see [`2.14.2...main`][2.14.2...main].
10+
11+
## [`2.14.2`][2.14.2]
12+
13+
For a full diff see [`2.14.1...2.14.2`][2.14.1...2.14.2].
14+
15+
### Fixed
16+
17+
- Adjusted `rules.neon` to register `Closures\NoParameterWithNullDefaultValueRule` ([#1140]), by [@alfredbez]
18+
19+
## [`2.14.1`][2.14.1]
20+
21+
For a full diff see [`2.14.0...2.14.1`][2.14.0...2.14.1].
22+
23+
### Fixed
24+
25+
- Adjusted `Methods\InvokeParentHookMethodRule` to detect the invocation of a parent hook method in a `finally` block ([#1139]), by [@localheinz]
1026

1127
## [`2.14.0`][2.14.0]
1228

@@ -676,7 +692,11 @@ For a full diff see [`362c7ea...0.1.0`][362c7ea...0.1.0].
676692
[2.13.0...2.13.1]: https://github.com/ergebnis/phpstan-rules/compare/2.13.0...2.13.1
677693
[2.13.1...2.14.0]: https://github.com/ergebnis/phpstan-rules/compare/2.13.1...2.14.0
678694
[2.14.0]: https://github.com/ergebnis/phpstan-rules/releases/tag/2.14.0
679-
[2.14.0...main]: https://github.com/ergebnis/phpstan-rules/compare/2.14.0...main
695+
[2.14.0...2.14.1]: https://github.com/ergebnis/phpstan-rules/compare/2.14.0...2.14.1
696+
[2.14.1]: https://github.com/ergebnis/phpstan-rules/releases/tag/2.14.1
697+
[2.14.1...2.14.2]: https://github.com/ergebnis/phpstan-rules/compare/2.14.1...2.14.2
698+
[2.14.2]: https://github.com/ergebnis/phpstan-rules/releases/tag/2.14.2
699+
[2.14.2...main]: https://github.com/ergebnis/phpstan-rules/compare/2.14.2...main
680700

681701
[#1]: https://github.com/ergebnis/phpstan-rules/pull/1
682702
[#4]: https://github.com/ergebnis/phpstan-rules/pull/4
@@ -780,7 +800,10 @@ For a full diff see [`362c7ea...0.1.0`][362c7ea...0.1.0].
780800
[#1011]: https://github.com/ergebnis/phpstan-rules/pull/1011
781801
[#1036]: https://github.com/ergebnis/phpstan-rules/pull/1036
782802
[#1101]: https://github.com/ergebnis/phpstan-rules/pull/1101
803+
[#1139]: https://github.com/ergebnis/phpstan-rules/pull/1139
804+
[#1140]: https://github.com/ergebnis/phpstan-rules/pull/1140
783805

806+
[@alfredbez]: https://github.com/alfredbez
784807
[@cosmastech]: https://github.com/cosmastech
785808
[@dmecke]: https://github.com/dmecke
786809
[@enumag]: https://github.com/enumag

‎tools/.phpstan/vendor/ergebnis/phpstan-rules/README.md‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -751,8 +751,6 @@ The maintainers of this project ask contributors to follow the [code of conduct]
751751

752752
The maintainers of this project provide limited support.
753753

754-
You can support the maintenance of this project by [sponsoring @ergebnis](https://github.com/sponsors/ergebnis).
755-
756754
## PHP Version Support Policy
757755

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

782780
## Social
783781

784-
Follow [@localheinz](https://twitter.com/intent/follow?screen_name=localheinz) and [@ergebnis](https://twitter.com/intent/follow?screen_name=ergebnis) on Twitter.
782+
Follow [@localheinz](https://x.com/intent/follow?screen_name=localheinz) and [@ergebnis](https://x.com/intent/follow?screen_name=ergebnis) on X.

‎tools/.phpstan/vendor/ergebnis/phpstan-rules/composer.json‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,16 @@
2828
"require-dev": {
2929
"codeception/codeception": "^4.0.0 || ^5.0.0",
3030
"doctrine/orm": "^2.20.0 || ^3.3.0",
31-
"ergebnis/composer-normalize": "^2.53.0",
32-
"ergebnis/license": "^2.7.0",
33-
"ergebnis/php-cs-fixer-config": "^6.63.2",
34-
"ergebnis/phpunit-slow-test-detector": "^2.25.0",
35-
"ergebnis/rector-rules": "^1.18.3",
31+
"ergebnis/composer-normalize": "^2.54.0",
32+
"ergebnis/license": "^2.8.0",
33+
"ergebnis/php-cs-fixer-config": "^6.64.1",
34+
"ergebnis/phpunit-slow-test-detector": "^2.26.0",
35+
"ergebnis/rector-rules": "^1.18.5",
3636
"fakerphp/faker": "^1.24.1",
3737
"phpstan/extension-installer": "^1.4.3",
3838
"phpstan/phpstan-deprecation-rules": "^2.0.5",
39-
"phpstan/phpstan-phpunit": "^2.0.18",
40-
"phpstan/phpstan-strict-rules": "^2.0.12",
39+
"phpstan/phpstan-phpunit": "^2.0.21",
40+
"phpstan/phpstan-strict-rules": "^2.1.0",
4141
"phpunit/phpunit": "^9.6.33",
4242
"psr/container": "^2.0.2",
4343
"rector/rector": "^2.3.8",

‎tools/.phpstan/vendor/ergebnis/phpstan-rules/rules.neon‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ conditionalTags:
1313
phpstan.rules.rule: %ergebnis.noParameterPassedByReference.enabled%
1414
Ergebnis\PHPStan\Rules\Closures\NoParameterWithNullableTypeDeclarationRule:
1515
phpstan.rules.rule: %ergebnis.noParameterWithNullableTypeDeclaration.enabled%
16+
Ergebnis\PHPStan\Rules\Closures\NoParameterWithNullDefaultValueRule:
17+
phpstan.rules.rule: %ergebnis.noParameterWithNullDefaultValue.enabled%
1618
Ergebnis\PHPStan\Rules\Expressions\NoAssignByReferenceRule:
1719
phpstan.rules.rule: %ergebnis.noAssignByReference.enabled%
1820
Ergebnis\PHPStan\Rules\Expressions\NoCompactRule:
@@ -227,6 +229,9 @@ services:
227229
-
228230
class: Ergebnis\PHPStan\Rules\Closures\NoParameterWithNullableTypeDeclarationRule
229231

232+
-
233+
class: Ergebnis\PHPStan\Rules\Closures\NoParameterWithNullDefaultValueRule
234+
230235
-
231236
class: Ergebnis\PHPStan\Rules\Expressions\NoAssignByReferenceRule
232237

‎tools/.phpstan/vendor/ergebnis/phpstan-rules/src/Methods/InvokeParentHookMethodRule.php‎

Lines changed: 57 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -223,46 +223,79 @@ private static function findParentHookMethodInvocation(
223223
$statementCount = \count($statementsWithOperations);
224224

225225
foreach ($statementsWithOperations as $index => $statement) {
226-
if (!$statement instanceof Node\Stmt\Expression) {
227-
continue;
228-
}
226+
if ($statement instanceof Node\Stmt\TryCatch) {
227+
if (!$statement->finally instanceof Node\Stmt\Finally_) {
228+
continue;
229+
}
229230

230-
if (!$statement->expr instanceof Node\Expr\StaticCall) {
231-
continue;
231+
$finallyInvocation = self::findParentHookMethodInvocation(
232+
\array_values($statement->finally->stmts),
233+
$hookMethod,
234+
);
235+
236+
if ($finallyInvocation->equals(Invocation::never())) {
237+
continue;
238+
}
239+
240+
if (
241+
$finallyInvocation->equals(Invocation::last())
242+
&& $statementCount - 1 === $index
243+
) {
244+
return Invocation::last();
245+
}
246+
247+
return Invocation::any();
232248
}
233249

234-
if (!$statement->expr->class instanceof Node\Name) {
250+
if (!self::isParentHookMethodInvocation($statement, $hookMethod)) {
235251
continue;
236252
}
237253

238-
$className = (string) $statement->expr->class;
254+
if (1 === $statementCount) {
255+
return $hookMethod->invocation();
256+
}
239257

240-
if (\mb_strtolower($className) !== 'parent') {
241-
continue;
258+
if (0 === $index) {
259+
return Invocation::first();
242260
}
243261

244-
if (!$statement->expr->name instanceof Node\Identifier) {
245-
continue;
262+
if ($statementCount - 1 === $index) {
263+
return Invocation::last();
246264
}
247265

248-
if (\mb_strtolower($statement->expr->name->toString()) === \mb_strtolower($hookMethod->methodName()->toString())) {
249-
if (1 === $statementCount) {
250-
return $hookMethod->invocation();
251-
}
266+
return Invocation::any();
267+
}
252268

253-
if (0 === $index) {
254-
return Invocation::first();
255-
}
269+
return Invocation::never();
270+
}
256271

257-
if ($statementCount - 1 === $index) {
258-
return Invocation::last();
259-
}
272+
private static function isParentHookMethodInvocation(
273+
Node\Stmt $statement,
274+
HookMethod $hookMethod
275+
): bool {
276+
if (!$statement instanceof Node\Stmt\Expression) {
277+
return false;
278+
}
260279

261-
return Invocation::any();
262-
}
280+
if (!$statement->expr instanceof Node\Expr\StaticCall) {
281+
return false;
263282
}
264283

265-
return Invocation::never();
284+
if (!$statement->expr->class instanceof Node\Name) {
285+
return false;
286+
}
287+
288+
$className = (string) $statement->expr->class;
289+
290+
if (\mb_strtolower($className) !== 'parent') {
291+
return false;
292+
}
293+
294+
if (!$statement->expr->name instanceof Node\Identifier) {
295+
return false;
296+
}
297+
298+
return \mb_strtolower($statement->expr->name->toString()) === \mb_strtolower($hookMethod->methodName()->toString());
266299
}
267300

268301
/**

0 commit comments

Comments
 (0)