Skip to content

Commit 94723d1

Browse files
Update tools
1 parent b3f3a3f commit 94723d1

File tree

7 files changed

+81
-59
lines changed

7 files changed

+81
-59
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.4"
7+
"ergebnis/phpstan-rules": "^2.10.5"
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.4",
6-
"version_normalized": "2.10.4.0",
5+
"version": "2.10.5",
6+
"version_normalized": "2.10.5.0",
77
"source": {
88
"type": "git",
99
"url": "https://github.com/ergebnis/phpstan-rules.git",
10-
"reference": "78c7646be7c229c6c23b02883b0015d36227150f"
10+
"reference": "719a53e793e2417da46d497f21fb8d2f007ecb78"
1111
},
1212
"dist": {
1313
"type": "zip",
14-
"url": "https://api.github.com/repos/ergebnis/phpstan-rules/zipball/78c7646be7c229c6c23b02883b0015d36227150f",
15-
"reference": "78c7646be7c229c6c23b02883b0015d36227150f",
14+
"url": "https://api.github.com/repos/ergebnis/phpstan-rules/zipball/719a53e793e2417da46d497f21fb8d2f007ecb78",
15+
"reference": "719a53e793e2417da46d497f21fb8d2f007ecb78",
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-07T08:06:40+00:00",
41+
"time": "2025-06-23T17:35:58+00:00",
4242
"type": "phpstan-extension",
4343
"extra": {
4444
"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' => '12.2.x-dev',
55
'version' => '12.2.9999999.9999999-dev',
6-
'reference' => 'cd83cfa117a076d2a8ba2693e59c6d26af2fbc7d',
6+
'reference' => 'b3f3a3f609fd9a55db9013792446190b08731195',
77
'type' => 'library',
88
'install_path' => __DIR__ . '/../../',
99
'aliases' => array(),
@@ -13,16 +13,16 @@
1313
'__root__' => array(
1414
'pretty_version' => '12.2.x-dev',
1515
'version' => '12.2.9999999.9999999-dev',
16-
'reference' => 'cd83cfa117a076d2a8ba2693e59c6d26af2fbc7d',
16+
'reference' => 'b3f3a3f609fd9a55db9013792446190b08731195',
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.4',
24-
'version' => '2.10.4.0',
25-
'reference' => '78c7646be7c229c6c23b02883b0015d36227150f',
23+
'pretty_version' => '2.10.5',
24+
'version' => '2.10.5.0',
25+
'reference' => '719a53e793e2417da46d497f21fb8d2f007ecb78',
2626
'type' => 'phpstan-extension',
2727
'install_path' => __DIR__ . '/../ergebnis/phpstan-rules',
2828
'aliases' => array(),

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

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,16 @@ 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.4...main`][2.10.4...main].
9+
For a full diff see [`2.10.5...main`][2.10.5...main].
10+
11+
## [`2.10.5`][2.10.5]
12+
13+
For a full diff see [`2.10.4...2.10.5`][2.10.4...2.10.5].
14+
15+
### Fixed
16+
17+
- Adjusted `Methods\NoNamedArgumentRule` to handle calls to constructors of variable class names ([#957]), by [@localheinz]
18+
- Adjusted `Methods\NoNamedArgumentRule` to describe known calls only ([#958]), by [@localheinz]
1019

1120
## [`2.10.4`][2.10.4]
1221

@@ -560,6 +569,7 @@ For a full diff see [`362c7ea...0.1.0`][362c7ea...0.1.0].
560569
[2.10.2]: https://github.com/ergebnis/phpstan-rules/releases/tag/2.10.2
561570
[2.10.3]: https://github.com/ergebnis/phpstan-rules/releases/tag/2.10.3
562571
[2.10.4]: https://github.com/ergebnis/phpstan-rules/releases/tag/2.10.4
572+
[2.10.5]: https://github.com/ergebnis/phpstan-rules/releases/tag/2.10.5
563573

564574
[362c7ea...0.1.0]: https://github.com/ergebnis/phpstan-rules/compare/362c7ea...0.1.0
565575
[0.1.0...0.2.0]: https://github.com/ergebnis/phpstan-rules/compare/0.1.0...0.2.0
@@ -607,7 +617,8 @@ For a full diff see [`362c7ea...0.1.0`][362c7ea...0.1.0].
607617
[2.10.1...2.10.2]: https://github.com/ergebnis/phpstan-rules/compare/2.10.1...2.10.2
608618
[2.10.2...2.10.3]: https://github.com/ergebnis/phpstan-rules/compare/2.10.2...2.10.3
609619
[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
620+
[2.10.4...2.10.5]: https://github.com/ergebnis/phpstan-rules/compare/2.10.4...2.10.5
621+
[2.10.5...main]: https://github.com/ergebnis/phpstan-rules/compare/2.10.5...main
611622

612623
[#1]: https://github.com/ergebnis/phpstan-rules/pull/1
613624
[#4]: https://github.com/ergebnis/phpstan-rules/pull/4
@@ -701,6 +712,8 @@ For a full diff see [`362c7ea...0.1.0`][362c7ea...0.1.0].
701712
[#948]: https://github.com/ergebnis/phpstan-rules/pull/948
702713
[#949]: https://github.com/ergebnis/phpstan-rules/pull/949
703714
[#951]: https://github.com/ergebnis/phpstan-rules/pull/951
715+
[#957]: https://github.com/ergebnis/phpstan-rules/pull/957
716+
[#958]: https://github.com/ergebnis/phpstan-rules/pull/958
704717

705718
[@cosmastech]: https://github.com/cosmastech
706719
[@enumag]: https://github.com/enumag

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

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

53-
$callable = self::describeCallable(
53+
$callLike = self::describeCallLike(
5454
$node,
5555
$scope,
5656
);
5757

58-
return \array_map(static function (Node\Arg $namedArgument) use ($callable): Rules\RuleError {
58+
return \array_map(static function (Node\Arg $namedArgument) use ($callLike): Rules\RuleError {
5959
/** @var Node\Identifier $argumentName */
6060
$argumentName = $namedArgument->name;
6161

6262
$message = \sprintf(
6363
'%s is invoked with named argument for parameter $%s.',
64-
$callable,
64+
$callLike,
6565
$argumentName->toString(),
6666
);
6767

@@ -71,7 +71,7 @@ public function processNode(
7171
}, $namedArguments);
7272
}
7373

74-
private static function describeCallable(
74+
private static function describeCallLike(
7575
Node\Expr\CallLike $node,
7676
Analyser\Scope $scope
7777
): string {
@@ -95,70 +95,79 @@ private static function describeCallable(
9595
if ($functionName instanceof Node\Name) {
9696
return \sprintf(
9797
'Function %s()',
98-
$functionName,
98+
$functionName->name,
9999
);
100100
}
101101
}
102102

103103
if ($node instanceof Node\Expr\MethodCall) {
104-
/** @var Node\Identifier $methodName */
105104
$methodName = $node->name;
106105

107-
$objectType = $scope->getType($node->var);
106+
if ($methodName instanceof Node\Identifier) {
107+
$objectType = $scope->getType($node->var);
108108

109-
$methodReflection = $scope->getMethodReflection(
110-
$objectType,
111-
$methodName->name,
112-
);
109+
$methodReflection = $scope->getMethodReflection(
110+
$objectType,
111+
$methodName->name,
112+
);
113113

114-
if (null === $methodReflection) {
115-
throw new ShouldNotHappenException();
116-
}
114+
if (null === $methodReflection) {
115+
throw new ShouldNotHappenException();
116+
}
117117

118-
$declaringClass = $methodReflection->getDeclaringClass();
118+
$declaringClass = $methodReflection->getDeclaringClass();
119+
120+
if ($declaringClass->isAnonymous()) {
121+
return \sprintf(
122+
'Method %s() of anonymous class',
123+
$methodName->toString(),
124+
);
125+
}
119126

120-
if ($declaringClass->isAnonymous()) {
121127
return \sprintf(
122-
'Method %s() of anonymous class',
123-
$methodName,
128+
'Method %s::%s()',
129+
$declaringClass->getName(),
130+
$methodName->toString(),
124131
);
125132
}
126133

127-
return \sprintf(
128-
'Method %s::%s()',
129-
$declaringClass->getName(),
130-
$methodName,
131-
);
134+
return 'Method';
132135
}
133136

134137
if ($node instanceof Node\Expr\StaticCall) {
135-
$className = $node->class;
136-
137-
/** @var Node\Identifier $methodName */
138138
$methodName = $node->name;
139139

140-
if ($className instanceof Node\Expr\Variable) {
140+
if ($methodName instanceof Node\Identifier) {
141+
$className = $node->class;
142+
143+
if ($className instanceof Node\Name) {
144+
return \sprintf(
145+
'Method %s::%s()',
146+
$className->toString(),
147+
$methodName->toString(),
148+
);
149+
}
150+
141151
return \sprintf(
142152
'Method %s()',
143-
$methodName,
153+
$methodName->toString(),
144154
);
145155
}
146156

147-
return \sprintf(
148-
'Method %s::%s()',
149-
$className,
150-
$methodName,
151-
);
157+
return 'Method';
152158
}
153159

154160
if ($node instanceof Node\Expr\New_) {
155-
/** @var Node\Name\FullyQualified $className */
156161
$className = $node->class;
157162

158-
return \sprintf(
159-
'Constructor of %s',
160-
$className->toString(),
161-
);
163+
if ($className instanceof Node\Name) {
164+
return \sprintf(
165+
'Constructor of %s',
166+
$className->toString(),
167+
);
168+
}
169+
170+
return 'Constructor';
162171
}
163172

164173
return 'Callable';

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.4',
24+
'version' => '2.10.5',
2525
'phpstanVersionConstraint' => '>=2.1.8.0-dev, <3.0.0.0-dev',
2626
),
2727
'phpstan/phpstan-strict-rules' =>

0 commit comments

Comments
 (0)