Skip to content

Commit c87c937

Browse files
Update tools
1 parent cd83cfa commit c87c937

File tree

8 files changed

+112
-112
lines changed

8 files changed

+112
-112
lines changed

tools/.phpstan/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"phpstan/extension-installer": "^1.4.3",
55
"phpstan/phpstan-strict-rules": "^2.0.4",
66
"tomasvotruba/type-coverage": "^2.0.2",
7-
"ergebnis/phpstan-rules": "^2.10.3"
7+
"ergebnis/phpstan-rules": "^2.10.4"
88
},
99
"config": {
1010
"allow-plugins": {

tools/.phpstan/composer.lock

Lines changed: 6 additions & 6 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: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22
"packages": [
33
{
44
"name": "ergebnis/phpstan-rules",
5-
"version": "2.10.3",
6-
"version_normalized": "2.10.3.0",
5+
"version": "2.10.4",
6+
"version_normalized": "2.10.4.0",
77
"source": {
88
"type": "git",
99
"url": "https://github.com/ergebnis/phpstan-rules.git",
10-
"reference": "a69bfa59f5b5faeca844054595a0d4ffcf5a8d23"
10+
"reference": "78c7646be7c229c6c23b02883b0015d36227150f"
1111
},
1212
"dist": {
1313
"type": "zip",
14-
"url": "https://api.github.com/repos/ergebnis/phpstan-rules/zipball/a69bfa59f5b5faeca844054595a0d4ffcf5a8d23",
15-
"reference": "a69bfa59f5b5faeca844054595a0d4ffcf5a8d23",
14+
"url": "https://api.github.com/repos/ergebnis/phpstan-rules/zipball/78c7646be7c229c6c23b02883b0015d36227150f",
15+
"reference": "78c7646be7c229c6c23b02883b0015d36227150f",
1616
"shasum": ""
1717
},
1818
"require": {
@@ -38,7 +38,7 @@
3838
"symfony/finder": "^5.4.45",
3939
"symfony/process": "^5.4.47"
4040
},
41-
"time": "2025-06-03T09:06:44+00:00",
41+
"time": "2025-06-07T08:06:40+00:00",
4242
"type": "phpstan-extension",
4343
"extra": {
4444
"phpstan": {

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
<?php return array(
22
'root' => array(
33
'name' => '__root__',
4-
'pretty_version' => 'dev-main',
5-
'version' => 'dev-main',
6-
'reference' => '9b8b840e9e72bf0f4fbcccbacff43b452e132ebf',
4+
'pretty_version' => '12.2.x-dev',
5+
'version' => '12.2.9999999.9999999-dev',
6+
'reference' => 'cd83cfa117a076d2a8ba2693e59c6d26af2fbc7d',
77
'type' => 'library',
88
'install_path' => __DIR__ . '/../../',
99
'aliases' => array(),
1010
'dev' => true,
1111
),
1212
'versions' => array(
1313
'__root__' => array(
14-
'pretty_version' => 'dev-main',
15-
'version' => 'dev-main',
16-
'reference' => '9b8b840e9e72bf0f4fbcccbacff43b452e132ebf',
14+
'pretty_version' => '12.2.x-dev',
15+
'version' => '12.2.9999999.9999999-dev',
16+
'reference' => 'cd83cfa117a076d2a8ba2693e59c6d26af2fbc7d',
1717
'type' => 'library',
1818
'install_path' => __DIR__ . '/../../',
1919
'aliases' => array(),
2020
'dev_requirement' => false,
2121
),
2222
'ergebnis/phpstan-rules' => array(
23-
'pretty_version' => '2.10.3',
24-
'version' => '2.10.3.0',
25-
'reference' => 'a69bfa59f5b5faeca844054595a0d4ffcf5a8d23',
23+
'pretty_version' => '2.10.4',
24+
'version' => '2.10.4.0',
25+
'reference' => '78c7646be7c229c6c23b02883b0015d36227150f',
2626
'type' => 'phpstan-extension',
2727
'install_path' => __DIR__ . '/../ergebnis/phpstan-rules',
2828
'aliases' => array(),

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

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,18 @@ 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.10.3...main`][2.10.3...main].
9+
For a full diff see [`2.10.4...main`][2.10.4...main].
10+
11+
## [`2.10.4`][2.10.4]
12+
13+
For a full diff see [`2.10.3...2.10.4`][2.10.3...2.10.4].
14+
15+
### Fixed
16+
17+
- Adjusted `Methods\NoNamedArgumentRule` to handle static calls on variable expressions ([#947]), by [@localheinz]
18+
- Adjusted `Methods\NoNamedArgumentRule` to handle calls on invokables ([#948]), by [@localheinz]
19+
- Adjusted `Methods\NoNamedArgumentRule` to handle calls on callables assigned to properties ([#949]), by [@localheinz]
20+
- Adjusted `Methods\NoNamedArgumentRule` to handle all other calls with generic error message ([#951]), by [@localheinz]
1021

1122
## [`2.10.3`][2.10.3]
1223

@@ -548,6 +559,7 @@ For a full diff see [`362c7ea...0.1.0`][362c7ea...0.1.0].
548559
[2.10.1]: https://github.com/ergebnis/phpstan-rules/releases/tag/2.10.1
549560
[2.10.2]: https://github.com/ergebnis/phpstan-rules/releases/tag/2.10.2
550561
[2.10.3]: https://github.com/ergebnis/phpstan-rules/releases/tag/2.10.3
562+
[2.10.4]: https://github.com/ergebnis/phpstan-rules/releases/tag/2.10.4
551563

552564
[362c7ea...0.1.0]: https://github.com/ergebnis/phpstan-rules/compare/362c7ea...0.1.0
553565
[0.1.0...0.2.0]: https://github.com/ergebnis/phpstan-rules/compare/0.1.0...0.2.0
@@ -594,7 +606,8 @@ For a full diff see [`362c7ea...0.1.0`][362c7ea...0.1.0].
594606
[2.10.0...2.10.1]: https://github.com/ergebnis/phpstan-rules/compare/2.10.0...2.10.1
595607
[2.10.1...2.10.2]: https://github.com/ergebnis/phpstan-rules/compare/2.10.1...2.10.2
596608
[2.10.2...2.10.3]: https://github.com/ergebnis/phpstan-rules/compare/2.10.2...2.10.3
597-
[2.10.3...main]: https://github.com/ergebnis/phpstan-rules/compare/2.10.3...main
609+
[2.10.3...2.10.4]: https://github.com/ergebnis/phpstan-rules/compare/2.10.3...2.10.4
610+
[2.10.4...main]: https://github.com/ergebnis/phpstan-rules/compare/2.10.4...main
598611

599612
[#1]: https://github.com/ergebnis/phpstan-rules/pull/1
600613
[#4]: https://github.com/ergebnis/phpstan-rules/pull/4
@@ -684,6 +697,10 @@ For a full diff see [`362c7ea...0.1.0`][362c7ea...0.1.0].
684697
[#940]: https://github.com/ergebnis/phpstan-rules/pull/940
685698
[#943]: https://github.com/ergebnis/phpstan-rules/pull/943
686699
[#944]: https://github.com/ergebnis/phpstan-rules/pull/944
700+
[#947]: https://github.com/ergebnis/phpstan-rules/pull/947
701+
[#948]: https://github.com/ergebnis/phpstan-rules/pull/948
702+
[#949]: https://github.com/ergebnis/phpstan-rules/pull/949
703+
[#951]: https://github.com/ergebnis/phpstan-rules/pull/951
687704

688705
[@cosmastech]: https://github.com/cosmastech
689706
[@enumag]: https://github.com/enumag

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -286,9 +286,9 @@ parameters:
286286
enabled: false
287287
```
288288

289-
#### `Expressions\NoEvalRule`
289+
#### `Expressions\NoErrorSuppressionRule`
290290

291-
This rule reports an error when the language construct [`eval()`](https://www.php.net/eval) is used.
291+
This rule reports an error when [`@`](https://www.php.net/manual/en/language.operators.errorcontrol.php) is used to suppress errors.
292292

293293
##### Disabling the rule
294294

@@ -297,13 +297,13 @@ You can set the `enabled` parameter to `false` to disable this rule.
297297
```neon
298298
parameters:
299299
ergebnis:
300-
noEval:
300+
noErrorSuppression:
301301
enabled: false
302302
```
303303

304-
#### `Expressions\NoErrorSuppressionRule`
304+
#### `Expressions\NoEvalRule`
305305

306-
This rule reports an error when [`@`](https://www.php.net/manual/en/language.operators.errorcontrol.php) is used to suppress errors.
306+
This rule reports an error when the language construct [`eval()`](https://www.php.net/eval) is used.
307307

308308
##### Disabling the rule
309309

@@ -312,7 +312,7 @@ You can set the `enabled` parameter to `false` to disable this rule.
312312
```neon
313313
parameters:
314314
ergebnis:
315-
noErrorSuppression:
315+
noEval:
316316
enabled: false
317317
```
318318

tools/.phpstan/vendor/ergebnis/phpstan-rules/src/CallLikes/NoNamedArgumentRule.php

Lines changed: 64 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -50,40 +50,54 @@ public function processNode(
5050
return [];
5151
}
5252

53+
$callable = self::describeCallable(
54+
$node,
55+
$scope,
56+
);
57+
58+
return \array_map(static function (Node\Arg $namedArgument) use ($callable): Rules\RuleError {
59+
/** @var Node\Identifier $argumentName */
60+
$argumentName = $namedArgument->name;
61+
62+
$message = \sprintf(
63+
'%s is invoked with named argument for parameter $%s.',
64+
$callable,
65+
$argumentName->toString(),
66+
);
67+
68+
return Rules\RuleErrorBuilder::message($message)
69+
->identifier(ErrorIdentifier::noNamedArgument()->toString())
70+
->build();
71+
}, $namedArguments);
72+
}
73+
74+
private static function describeCallable(
75+
Node\Expr\CallLike $node,
76+
Analyser\Scope $scope
77+
): string {
5378
if ($node instanceof Node\Expr\FuncCall) {
5479
$functionName = $node->name;
5580

56-
if ($functionName instanceof Node\Expr\Variable) {
57-
return \array_map(static function (Node\Arg $namedArgument) use ($functionName): Rules\RuleError {
58-
/** @var Node\Identifier $argumentName */
59-
$argumentName = $namedArgument->name;
60-
61-
$message = \sprintf(
62-
'Anonymous function referenced by $%s is invoked with named argument for parameter $%s.',
63-
$functionName->name,
64-
$argumentName->toString(),
65-
);
66-
67-
return Rules\RuleErrorBuilder::message($message)
68-
->identifier(ErrorIdentifier::noNamedArgument()->toString())
69-
->build();
70-
}, $namedArguments);
81+
if ($functionName instanceof Node\Expr\PropertyFetch) {
82+
return \sprintf(
83+
'Callable referenced by property $%s',
84+
$functionName->name,
85+
);
7186
}
7287

73-
return \array_map(static function (Node\Arg $namedArgument) use ($functionName): Rules\RuleError {
74-
/** @var Node\Identifier $argumentName */
75-
$argumentName = $namedArgument->name;
88+
if ($functionName instanceof Node\Expr\Variable) {
89+
return \sprintf(
90+
'Callable referenced by $%s',
91+
$functionName->name,
92+
);
93+
}
7694

77-
$message = \sprintf(
78-
'Function %s() is invoked with named argument for parameter $%s.',
95+
if ($functionName instanceof Node\Name) {
96+
return \sprintf(
97+
'Function %s()',
7998
$functionName,
80-
$argumentName->toString(),
8199
);
82-
83-
return Rules\RuleErrorBuilder::message($message)
84-
->identifier(ErrorIdentifier::noNamedArgument()->toString())
85-
->build();
86-
}, $namedArguments);
100+
}
87101
}
88102

89103
if ($node instanceof Node\Expr\MethodCall) {
@@ -104,80 +118,49 @@ public function processNode(
104118
$declaringClass = $methodReflection->getDeclaringClass();
105119

106120
if ($declaringClass->isAnonymous()) {
107-
return \array_map(static function (Node\Arg $namedArgument) use ($methodName): Rules\RuleError {
108-
/** @var Node\Identifier $argumentName */
109-
$argumentName = $namedArgument->name;
110-
111-
$message = \sprintf(
112-
'Method %s() of anonymous class is invoked with named argument for parameter $%s.',
113-
$methodName,
114-
$argumentName->toString(),
115-
);
116-
117-
return Rules\RuleErrorBuilder::message($message)
118-
->identifier(ErrorIdentifier::noNamedArgument()->toString())
119-
->build();
120-
}, $namedArguments);
121-
}
122-
123-
return \array_map(static function (Node\Arg $namedArgument) use ($declaringClass, $methodName): Rules\RuleError {
124-
/** @var Node\Identifier $argumentName */
125-
$argumentName = $namedArgument->name;
126-
127-
$message = \sprintf(
128-
'Method %s::%s() is invoked with named argument for parameter $%s.',
129-
$declaringClass->getName(),
121+
return \sprintf(
122+
'Method %s() of anonymous class',
130123
$methodName,
131-
$argumentName->toString(),
132124
);
125+
}
133126

134-
return Rules\RuleErrorBuilder::message($message)
135-
->identifier(ErrorIdentifier::noNamedArgument()->toString())
136-
->build();
137-
}, $namedArguments);
127+
return \sprintf(
128+
'Method %s::%s()',
129+
$declaringClass->getName(),
130+
$methodName,
131+
);
138132
}
139133

140134
if ($node instanceof Node\Expr\StaticCall) {
141135
$className = $node->class;
142-
$methodName = $node->name;
143136

144-
return \array_map(static function (Node\Arg $namedArgument) use ($className, $methodName): Rules\RuleError {
145-
/** @var Node\Identifier $argumentName */
146-
$argumentName = $namedArgument->name;
137+
/** @var Node\Identifier $methodName */
138+
$methodName = $node->name;
147139

148-
$message = \sprintf(
149-
'Method %s::%s() is invoked with named argument for parameter $%s.',
150-
$className,
140+
if ($className instanceof Node\Expr\Variable) {
141+
return \sprintf(
142+
'Method %s()',
151143
$methodName,
152-
$argumentName->toString(),
153144
);
145+
}
154146

155-
return Rules\RuleErrorBuilder::message($message)
156-
->identifier(ErrorIdentifier::noNamedArgument()->toString())
157-
->build();
158-
}, $namedArguments);
147+
return \sprintf(
148+
'Method %s::%s()',
149+
$className,
150+
$methodName,
151+
);
159152
}
160153

161154
if ($node instanceof Node\Expr\New_) {
162155
/** @var Node\Name\FullyQualified $className */
163156
$className = $node->class;
164157

165-
return \array_map(static function (Node\Arg $namedArgument) use ($className): Rules\RuleError {
166-
/** @var Node\Identifier $argumentName */
167-
$argumentName = $namedArgument->name;
168-
169-
$message = \sprintf(
170-
'Constructor of %s is invoked with named argument for parameter $%s.',
171-
$className->toString(),
172-
$argumentName->toString(),
173-
);
174-
175-
return Rules\RuleErrorBuilder::message($message)
176-
->identifier(ErrorIdentifier::noNamedArgument()->toString())
177-
->build();
178-
}, $namedArguments);
158+
return \sprintf(
159+
'Constructor of %s',
160+
$className->toString(),
161+
);
179162
}
180163

181-
return [];
164+
return 'Callable';
182165
}
183166
}

tools/.phpstan/vendor/phpstan/extension-installer/src/GeneratedConfig.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ final class GeneratedConfig
2121
0 => 'rules.neon',
2222
),
2323
),
24-
'version' => '2.10.3',
24+
'version' => '2.10.4',
2525
'phpstanVersionConstraint' => '>=2.1.8.0-dev, <3.0.0.0-dev',
2626
),
2727
'phpstan/phpstan-strict-rules' =>

0 commit comments

Comments
 (0)