Skip to content

Commit 7923bd5

Browse files
committed
Rector 1.2.9
1 parent cd29621 commit 7923bd5

File tree

5 files changed

+22
-13
lines changed

5 files changed

+22
-13
lines changed

src/Application/VersionResolver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ final class VersionResolver
1919
* @api
2020
* @var string
2121
*/
22-
public const PACKAGE_VERSION = '2d862a7c7750c79e4c16be6e7c4e87ba324abfa7';
22+
public const PACKAGE_VERSION = '1.2.9';
2323
/**
2424
* @api
2525
* @var string

vendor/composer/installed.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1811,12 +1811,12 @@
18111811
"source": {
18121812
"type": "git",
18131813
"url": "https:\/\/github.com\/rectorphp\/rector-phpunit.git",
1814-
"reference": "a5265a86d96a9ba7d7f9dbc20a19a3a665db70f2"
1814+
"reference": "6c454ff1341a7669f80d238eeaeab6a22cace13d"
18151815
},
18161816
"dist": {
18171817
"type": "zip",
1818-
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-phpunit\/zipball\/a5265a86d96a9ba7d7f9dbc20a19a3a665db70f2",
1819-
"reference": "a5265a86d96a9ba7d7f9dbc20a19a3a665db70f2",
1818+
"url": "https:\/\/api.github.com\/repos\/rectorphp\/rector-phpunit\/zipball\/6c454ff1341a7669f80d238eeaeab6a22cace13d",
1819+
"reference": "6c454ff1341a7669f80d238eeaeab6a22cace13d",
18201820
"shasum": ""
18211821
},
18221822
"require": {
@@ -1840,7 +1840,7 @@
18401840
"tomasvotruba\/class-leak": "^1.0",
18411841
"tracy\/tracy": "^2.10"
18421842
},
1843-
"time": "2024-11-04T17:53:42+00:00",
1843+
"time": "2024-11-04T18:23:18+00:00",
18441844
"default-branch": true,
18451845
"type": "rector-extension",
18461846
"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 e75008c'), '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 d9cef57'), '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 a5265a8'), '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 799b454'));
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 e75008c'), '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 d9cef57'), '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 6c454ff'), '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 799b454'));
1313
private function __construct()
1414
{
1515
}

vendor/rector/rector-phpunit/rules/CodeQuality/Rector/MethodCall/AssertCompareOnCountableWithMethodToAssertCountRector.php

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
use PhpParser\Node;
77
use PhpParser\Node\Arg;
8+
use PhpParser\Node\Expr\FuncCall;
89
use PhpParser\Node\Expr\MethodCall;
910
use PhpParser\Node\Expr\StaticCall;
1011
use PhpParser\Node\Identifier;
@@ -56,15 +57,23 @@ public function refactor(Node $node)
5657
if ($node->isFirstClassCallable()) {
5758
return null;
5859
}
59-
if (\count($node->getArgs()) < 2) {
60+
$assertArgs = $node->getArgs();
61+
if (\count($assertArgs) < 2) {
6062
return null;
6163
}
62-
$right = $node->getArgs()[1]->value;
63-
if ($right instanceof MethodCall && $right->name instanceof Identifier && $right->name->toLowerString() === 'count' && $right->getArgs() === []) {
64-
$type = $this->getType($right->var);
64+
$comparedExpr = $assertArgs[1]->value;
65+
if ($comparedExpr instanceof FuncCall && $this->isName($comparedExpr->name, 'count')) {
66+
$countArg = $comparedExpr->getArgs()[0];
67+
$assertArgs[1] = new Arg($countArg->value);
68+
$node->args = $assertArgs;
69+
$node->name = new Identifier('assertCount');
70+
return $node;
71+
}
72+
if ($comparedExpr instanceof MethodCall && $this->isName($comparedExpr->name, 'count') && $comparedExpr->getArgs() === []) {
73+
$type = $this->getType($comparedExpr->var);
6574
if ((new ObjectType('Countable'))->isSuperTypeOf($type)->yes()) {
66-
$args = $node->getArgs();
67-
$args[1] = new Arg($right->var);
75+
$args = $assertArgs;
76+
$args[1] = new Arg($comparedExpr->var);
6877
$node->args = $args;
6978
$node->name = new Identifier('assertCount');
7079
}

0 commit comments

Comments
 (0)