Skip to content

Commit 4147350

Browse files
committed
Updated Rector to commit 142f1c81c7a9d26fd5119526186aba14f4cf6382
rectorphp/rector-src@142f1c8 [DeadCode] Handle only remove 1 @var on multi vars on RemoveUselessVarTagRector (#7884)
1 parent f3947a1 commit 4147350

5 files changed

Lines changed: 17 additions & 6 deletions

File tree

vendor/composer/installed.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1818,12 +1818,12 @@
18181818
"source": {
18191819
"type": "git",
18201820
"url": "https:\/\/github.com\/rectorphp\/rector-phpunit.git",
1821-
"reference": "5eee71ed18bca5ae80a2e545dac7015fc769a499"
1821+
"reference": "9058a4668cae38e331f8a8a60ec382eb111148c8"
18221822
},
18231823
"dist": {
18241824
"type": "zip",
1825-
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-phpunit\/zipball\/5eee71ed18bca5ae80a2e545dac7015fc769a499",
1826-
"reference": "5eee71ed18bca5ae80a2e545dac7015fc769a499",
1825+
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-phpunit\/zipball\/9058a4668cae38e331f8a8a60ec382eb111148c8",
1826+
"reference": "9058a4668cae38e331f8a8a60ec382eb111148c8",
18271827
"shasum": ""
18281828
},
18291829
"require": {
@@ -1850,7 +1850,7 @@
18501850
"tomasvotruba\/unused-public": "^2.2",
18511851
"tracy\/tracy": "^2.11"
18521852
},
1853-
"time": "2026-02-07T13:48:42+00:00",
1853+
"time": "2026-02-07T19:25:47+00:00",
18541854
"default-branch": true,
18551855
"type": "rector-extension",
18561856
"extra": {

vendor/composer/installed.php

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

vendor/rector/extension-installer/src/GeneratedConfig.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*/
1010
final class GeneratedConfig
1111
{
12-
public const EXTENSIONS = array('rector/rector-doctrine' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-doctrine', 'relative_install_path' => '../../rector-doctrine', 'extra' => NULL, 'version' => 'dev-main 46e4f77'), 'rector/rector-downgrade-php' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-downgrade-php', 'relative_install_path' => '../../rector-downgrade-php', 'extra' => NULL, 'version' => 'dev-main a110e2f'), 'rector/rector-phpunit' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-phpunit', 'relative_install_path' => '../../rector-phpunit', 'extra' => NULL, 'version' => 'dev-main 5eee71e'), 'rector/rector-symfony' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-symfony', 'relative_install_path' => '../../rector-symfony', 'extra' => NULL, 'version' => 'dev-main eadb590'));
12+
public const EXTENSIONS = array('rector/rector-doctrine' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-doctrine', 'relative_install_path' => '../../rector-doctrine', 'extra' => NULL, 'version' => 'dev-main 46e4f77'), 'rector/rector-downgrade-php' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-downgrade-php', 'relative_install_path' => '../../rector-downgrade-php', 'extra' => NULL, 'version' => 'dev-main a110e2f'), 'rector/rector-phpunit' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-phpunit', 'relative_install_path' => '../../rector-phpunit', 'extra' => NULL, 'version' => 'dev-main 9058a46'), 'rector/rector-symfony' => array('install_path' => '/home/runner/work/rector-src/rector-src/rector-build/vendor/rector/rector-symfony', 'relative_install_path' => '../../rector-symfony', 'extra' => NULL, 'version' => 'dev-main eadb590'));
1313
private function __construct()
1414
{
1515
}

vendor/rector/rector-phpunit/rules/CodeQuality/Rector/Expression/DecorateWillReturnMapWithExpectsMockRector.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
use PhpParser\Node\Identifier;
1212
use PhpParser\Node\Scalar\Int_;
1313
use PhpParser\Node\Stmt\Expression;
14+
use PHPStan\Type\ObjectType;
1415
use Rector\PHPStan\ScopeFetcher;
16+
use Rector\PHPUnit\Enum\PHPUnitClassName;
1517
use Rector\Rector\AbstractRector;
1618
use Rector\ValueObject\MethodName;
1719
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
@@ -93,6 +95,9 @@ public function refactor(Node $node)
9395
if ($this->isName($topmostCall->name, 'expects')) {
9496
return null;
9597
}
98+
if (!$this->isObjectType($topmostCall->var, new ObjectType(PHPUnitClassName::MOCK_OBJECT))) {
99+
return null;
100+
}
96101
if ($methodCall->isFirstClassCallable()) {
97102
return null;
98103
}

vendor/rector/rector-phpunit/rules/PHPUnit120/Rector/Class_/AllowMockObjectsWithoutExpectationsAttributeRector.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
use PhpParser\Node\Stmt\Class_;
1515
use PhpParser\Node\Stmt\ClassMethod;
1616
use PHPStan\Reflection\ReflectionProvider;
17+
use PHPStan\Type\NeverType;
18+
use PHPStan\Type\ObjectType;
1719
use Rector\Doctrine\NodeAnalyzer\AttributeFinder;
1820
use Rector\PhpParser\Node\BetterNodeFinder;
1921
use Rector\PHPUnit\Enum\PHPUnitAttribute;
@@ -250,6 +252,10 @@ private function isMissingExpectsOnMockObjectMethodCallInSetUp(Class_ $class): b
250252
if (!$this->isName($methodCall->name, 'method')) {
251253
continue;
252254
}
255+
$type = $this->getType($methodCall->var);
256+
if (!$type instanceof NeverType && !$this->isObjectType($methodCall->var, new ObjectType(PHPUnitClassName::MOCK_OBJECT))) {
257+
continue;
258+
}
253259
if ($methodCall->var instanceof Variable || $methodCall->var instanceof PropertyFetch) {
254260
return \true;
255261
}

0 commit comments

Comments
 (0)