Skip to content

Commit aa2be08

Browse files
Bump phpstan/phpstan from 2.0.4 to 2.1.0 (#804)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Markus Staab <maggus.staab@googlemail.com>
1 parent 682ea79 commit aa2be08

File tree

9 files changed

+59
-74
lines changed

9 files changed

+59
-74
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"php": ">=7.4",
44
"justinrainbow/json-schema": "^5.3",
55
"php-parallel-lint/php-parallel-lint": "1.4",
6-
"phpstan/phpstan": "2.0.4",
6+
"phpstan/phpstan": "2.1.0",
77
"phpstan/phpstan-deprecation-rules": "2.0.1",
88
"phpstan/phpstan-phpunit": "2.0.3",
99
"phpstan/phpstan-strict-rules": "2.0.1",

composer.lock

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

vendor/composer/installed.json

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1019,17 +1019,17 @@
10191019
},
10201020
{
10211021
"name": "phpstan/phpstan",
1022-
"version": "2.0.4",
1023-
"version_normalized": "2.0.4.0",
1022+
"version": "2.1.0",
1023+
"version_normalized": "2.1.0.0",
10241024
"source": {
10251025
"type": "git",
10261026
"url": "https://github.com/phpstan/phpstan.git",
1027-
"reference": "50d276fc3bf1430ec315f2f109bbde2769821524"
1027+
"reference": "2392d360fdf54ea253aa6c68cad1d4ba2e54e927"
10281028
},
10291029
"dist": {
10301030
"type": "zip",
1031-
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/50d276fc3bf1430ec315f2f109bbde2769821524",
1032-
"reference": "50d276fc3bf1430ec315f2f109bbde2769821524",
1031+
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/2392d360fdf54ea253aa6c68cad1d4ba2e54e927",
1032+
"reference": "2392d360fdf54ea253aa6c68cad1d4ba2e54e927",
10331033
"shasum": ""
10341034
},
10351035
"require": {
@@ -1038,7 +1038,7 @@
10381038
"conflict": {
10391039
"phpstan/phpstan-shim": "*"
10401040
},
1041-
"time": "2024-12-17T17:14:01+00:00",
1041+
"time": "2024-12-31T07:30:03+00:00",
10421042
"bin": [
10431043
"phpstan",
10441044
"phpstan.phar"
@@ -1663,17 +1663,17 @@
16631663
},
16641664
{
16651665
"name": "staabm/phpstan-dba",
1666-
"version": "0.3.1",
1667-
"version_normalized": "0.3.1.0",
1666+
"version": "0.3.3",
1667+
"version_normalized": "0.3.3.0",
16681668
"source": {
16691669
"type": "git",
16701670
"url": "https://github.com/staabm/phpstan-dba.git",
1671-
"reference": "6dac52ebaa925ea05b3e178ed3bb4dbf87be29f2"
1671+
"reference": "525a9fae5d03f482ada9dd31d1ce039a11565a2d"
16721672
},
16731673
"dist": {
16741674
"type": "zip",
1675-
"url": "https://api.github.com/repos/staabm/phpstan-dba/zipball/6dac52ebaa925ea05b3e178ed3bb4dbf87be29f2",
1676-
"reference": "6dac52ebaa925ea05b3e178ed3bb4dbf87be29f2",
1675+
"url": "https://api.github.com/repos/staabm/phpstan-dba/zipball/525a9fae5d03f482ada9dd31d1ce039a11565a2d",
1676+
"reference": "525a9fae5d03f482ada9dd31d1ce039a11565a2d",
16771677
"shasum": ""
16781678
},
16791679
"require": {
@@ -1696,10 +1696,11 @@
16961696
"phpstan/phpstan-phpunit": "^2.0",
16971697
"phpstan/phpstan-strict-rules": "^2.0",
16981698
"phpunit/phpunit": "^8.5|^9.5",
1699-
"symplify/easy-coding-standard": "^12.3",
1699+
"symplify/easy-coding-standard": "^12.5",
1700+
"tomasvotruba/unused-public": "^2.0",
17001701
"vlucas/phpdotenv": "^5.4"
17011702
},
1702-
"time": "2024-11-26T21:46:03+00:00",
1703+
"time": "2024-12-30T15:49:02+00:00",
17031704
"type": "phpstan-extension",
17041705
"extra": {
17051706
"phpstan": {
@@ -1731,7 +1732,7 @@
17311732
],
17321733
"support": {
17331734
"issues": "https://github.com/staabm/phpstan-dba/issues",
1734-
"source": "https://github.com/staabm/phpstan-dba/tree/0.3.1"
1735+
"source": "https://github.com/staabm/phpstan-dba/tree/0.3.3"
17351736
},
17361737
"funding": [
17371738
{

vendor/composer/installed.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
'name' => '__root__',
44
'pretty_version' => 'dev-main',
55
'version' => 'dev-main',
6-
'reference' => 'ae31f562e8bf220718ed3aafc0db312f21efba4c',
6+
'reference' => '72195f90409add0d84bc34b8ee2dc195ab20c589',
77
'type' => 'library',
88
'install_path' => __DIR__ . '/../../',
99
'aliases' => array(),
@@ -13,7 +13,7 @@
1313
'__root__' => array(
1414
'pretty_version' => 'dev-main',
1515
'version' => 'dev-main',
16-
'reference' => 'ae31f562e8bf220718ed3aafc0db312f21efba4c',
16+
'reference' => '72195f90409add0d84bc34b8ee2dc195ab20c589',
1717
'type' => 'library',
1818
'install_path' => __DIR__ . '/../../',
1919
'aliases' => array(),
@@ -149,9 +149,9 @@
149149
'dev_requirement' => false,
150150
),
151151
'phpstan/phpstan' => array(
152-
'pretty_version' => '2.0.4',
153-
'version' => '2.0.4.0',
154-
'reference' => '50d276fc3bf1430ec315f2f109bbde2769821524',
152+
'pretty_version' => '2.1.0',
153+
'version' => '2.1.0.0',
154+
'reference' => '2392d360fdf54ea253aa6c68cad1d4ba2e54e927',
155155
'type' => 'library',
156156
'install_path' => __DIR__ . '/../phpstan/phpstan',
157157
'aliases' => array(),
@@ -248,9 +248,9 @@
248248
'dev_requirement' => false,
249249
),
250250
'staabm/phpstan-dba' => array(
251-
'pretty_version' => '0.3.1',
252-
'version' => '0.3.1.0',
253-
'reference' => '6dac52ebaa925ea05b3e178ed3bb4dbf87be29f2',
251+
'pretty_version' => '0.3.3',
252+
'version' => '0.3.3.0',
253+
'reference' => '525a9fae5d03f482ada9dd31d1ce039a11565a2d',
254254
'type' => 'phpstan-extension',
255255
'install_path' => __DIR__ . '/../staabm/phpstan-dba',
256256
'aliases' => array(),
103 KB
Binary file not shown.
Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
-----BEGIN PGP SIGNATURE-----
22

3-
iQIzBAABCgAdFiEEynwsejDI6OEnSoR2UcZzBf/C5cAFAmdhsTIACgkQUcZzBf/C
4-
5cAxtQ//a0q8ZsH8aOlSksbcQcAfq89wcFUkJmGjW5xsZwwUjKptZa9QlecuMnWg
5-
mysYMVieTbVuxnImTTkeh1kJbTTIrM6zNeU69+AYaLx7mhpAcQ8LyK4KZltBNtqc
6-
g1p5SN8V7mReooTDBtJVmpZ4HFDcwwcMoInKK6SsRYvEsv/FpT+CElLRuUtd8MUr
7-
2f58zUZSYAjTDSlcDCkfKdpdTjWh0veT+qDdWzZV4GWF8tPcPx6Wp03bmM6tR72b
8-
anjedeuLZ6X0JbH8vVGfnLFkApoF9nTV1QWlgWsTolmiqkc85feDmGY22wTIkIBs
9-
Cuy6d+E+JPdCJO9JUVH4rBvvJponOJ6+Guj2n2CB+Nezwb8DqYhaIPBWPA6Vw/jO
10-
TN27vyyKx32JXSiYmj96Pkb4KiC3tTX+4Y6HzxmRLgvws2IM2/yRBTD1wVZCFdvt
11-
/aqwPrX0+1DG7/B6mPV91EI5wT669UT/xhUfFA1SGTYj+lxWZE53RUSSIbWixLAc
12-
Qhdg0lX/zODImSYAJRzA5qLu+k3Kg0A9Lgmqp0zWIqY/AbgV112nZ3wHZc7P+k5+
13-
y6l7u7qAFK3nTsVFiCQo4Rrr1gXTX45awMegeqt/ynTF6IGg9XV0ORAv86BnKZBe
14-
3Os52r90a75+jS8M7DkBSQNsXzyMyN0sndZKLQu4m33qUhQv30Q=
15-
=+nLt
3+
iQIzBAABCgAdFiEEynwsejDI6OEnSoR2UcZzBf/C5cAFAmdznWEACgkQUcZzBf/C
4+
5cAdoA//dmRyUyjyVwbfP9j9d2u554JWJ3aOlJb5r3XrXITlVg46QcBXz4GsrhP1
5+
/CrGUwz5LOMzDxfvDs/N223I4d0SiAlbB+StQjpXXTX182cZ3p+3QdkZQLoI7QQc
6+
SxpFV9VEXlrKtVH9iDjTgXR/WHseVv5X16BJ67jJhTM6Vzqh5UnFit+Oop+W1Dbw
7+
NHfngQuZVGI2Felr3cL6FPsfT5cXwY+igb8VgRAA1v+u9+O0OdRA205T4idEvANv
8+
BP3nawt8awx9e3RdijVUS+6DuvK8Fsa7BW68nklmbIFHXhXmMOUZvHgCSThN+b39
9+
8Oaj1tuj8IM8Ur46yIkmF0yc1+lizKxVa4h3AcUphnXxIsM9WxCPtC1RcVT/XHGA
10+
8gW1QeVS/HkcAu1hrKnbgyj7kJ1T6oEDyV1n6ty9+M2mh54G74epTuTK+CVI8QA0
11+
3GbmQgJRd1PTC/EPfZNmPywRDD7yoMSKvHmOUP5NMHBsYhVPJILdIJAGEI/0G9as
12+
xxGDXk5zJNgn8OtR5GwLJw9GBBVMhuwYomvN/B/7rEz0qGT9/tsZlVosc9tod5cS
13+
4AwLDEQlNZatYmADPNfJc4wd+NuKV32s+srJedP8sXyPE8yCBX0PXv1FO1s9DUzK
14+
Qy1aLGWdhhT2AADQoyt7AUoEej9537wVB9fVmdCv1PzxrrMMzZQ=
15+
=PoVL
1616
-----END PGP SIGNATURE-----

vendor/staabm/phpstan-dba/composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
"phpstan/phpstan-phpunit": "^2.0",
2121
"phpstan/phpstan-strict-rules": "^2.0",
2222
"phpunit/phpunit": "^8.5|^9.5",
23-
"symplify/easy-coding-standard": "^12.3",
23+
"symplify/easy-coding-standard": "^12.5",
24+
"tomasvotruba/unused-public": "^2.0",
2425
"vlucas/phpdotenv": "^5.4"
2526
},
2627
"conflict": {

vendor/staabm/phpstan-dba/src/Ast/ExpressionFinder.php

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
use PhpParser\Node\Expr\AssignOp;
1111
use PhpParser\Node\Expr\MethodCall;
1212
use PhpParser\Node\Expr\Variable;
13-
use PhpParser\Node\FunctionLike;
1413
use PhpParser\NodeFinder;
1514
use PHPStan\ShouldNotHappenException;
1615

@@ -135,6 +134,10 @@ private function findFirstPreviousOfNode(Node $node, callable $filter): ?Node
135134
// move to previous expression
136135
$previousStatement = $node->getAttribute(PreviousConnectingVisitor::ATTRIBUTE_PREVIOUS);
137136
if (null !== $previousStatement) {
137+
if ($previousStatement instanceof \WeakReference) {
138+
$previousStatement = $previousStatement->get();
139+
}
140+
138141
if (! $previousStatement instanceof Node) {
139142
throw new ShouldNotHappenException();
140143
}
@@ -147,15 +150,6 @@ private function findFirstPreviousOfNode(Node $node, callable $filter): ?Node
147150
return $this->findFirstPreviousOfNode($previousStatement, $filter);
148151
}
149152

150-
$parent = $node->getAttribute(PreviousConnectingVisitor::ATTRIBUTE_PARENT);
151-
if ($parent instanceof FunctionLike) {
152-
return null;
153-
}
154-
155-
if ($parent instanceof Node) {
156-
return $this->findFirstPreviousOfNode($parent, $filter);
157-
}
158-
159153
return null;
160154
}
161155

vendor/staabm/phpstan-dba/src/Ast/PreviousConnectingVisitor.php

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,13 @@
66

77
use PhpParser\Node;
88
use PhpParser\NodeVisitorAbstract;
9+
use PHPStan\Node\VirtualNode;
910
use staabm\PHPStanDba\QueryReflection\DIContainerBridge;
10-
use function array_pop;
1111

1212
final class PreviousConnectingVisitor extends NodeVisitorAbstract
1313
{
14-
public const ATTRIBUTE_PARENT = 'dba-parent';
15-
1614
public const ATTRIBUTE_PREVIOUS = 'dba-previous';
1715

18-
/**
19-
* @var list<Node>
20-
*/
21-
private array $stack = [];
22-
2316
private ?Node $previous;
2417

2518
// a dummy property to force instantiation of DIContainerBridge
@@ -33,33 +26,29 @@ public function __construct(DIContainerBridge $dummyParameter)
3326

3427
public function beforeTraverse(array $nodes)
3528
{
36-
$this->stack = [];
3729
$this->previous = null;
3830

3931
return null;
4032
}
4133

4234
public function enterNode(Node $node)
4335
{
44-
if ([] !== $this->stack) {
45-
$node->setAttribute(self::ATTRIBUTE_PARENT, $this->stack[\count($this->stack) - 1]);
46-
}
47-
48-
if (null !== $this->previous && $this->previous->getAttribute(self::ATTRIBUTE_PARENT) === $node->getAttribute(self::ATTRIBUTE_PARENT)) {
49-
$node->setAttribute(self::ATTRIBUTE_PREVIOUS, $this->previous);
36+
if (
37+
null !== $this->previous
38+
&& ! $this->previous instanceof Node\FunctionLike
39+
&& ! $this->previous instanceof Node\Stmt\ClassLike
40+
&& ! $this->previous instanceof VirtualNode
41+
) {
42+
$node->setAttribute(self::ATTRIBUTE_PREVIOUS, \WeakReference::create($this->previous));
5043
}
5144

52-
$this->stack[] = $node;
53-
5445
return null;
5546
}
5647

5748
public function leaveNode(Node $node)
5849
{
5950
$this->previous = $node;
6051

61-
array_pop($this->stack);
62-
6352
return null;
6453
}
6554
}

0 commit comments

Comments
 (0)