Skip to content

Commit 6bae5d6

Browse files
kaizen-ciTomasVotruba
kaizen-ci
authored andcommitted
[ci-review] Rector Rectify
1 parent 76f731f commit 6bae5d6

File tree

4 files changed

+5
-77
lines changed

4 files changed

+5
-77
lines changed

composer.json

-7
Original file line numberDiff line numberDiff line change
@@ -109,16 +109,9 @@
109109
"rules-tests/Symfony4/Rector/MethodCall/ContainerGetToConstructorInjectionRector/Source"
110110
],
111111
"files": [
112-
<<<<<<< HEAD
113-
<<<<<<< HEAD
114112
"stubs/Symfony/Component/Form/FormTypeInterface.php",
115113
"stubs/Doctrine/Persistence/ObjectManager.php",
116114
"stubs/Doctrine/Common/Persistence/ObjectManager.php",
117-
=======
118-
"ci/downgrade/config/configuration.php",
119-
>>>>>>> d4f0e90b5c... [downgrade] simplify to 2 configs
120-
=======
121-
>>>>>>> f8a7c10791... rename downgrade_packages.sh to downgrade_rector_to_php71.sh
122115
"vendor/nette/forms/src/Forms/Controls/SubmitButton.php",
123116
"rules-tests/Restoration/Rector/Use_/RestoreFullyQualifiedNameRector/Source/ShortClassOnly.php",
124117
"rules-tests/DeadCode/Rector/MethodCall/RemoveDefaultArgumentValueRector/Source/UserDefined.php",

phpstan.neon

-35
Original file line numberDiff line numberDiff line change
@@ -576,46 +576,11 @@ parameters:
576576
- rules/Symfony/ConstantNameAndValueMatcher.php
577577
- rules/Privatization/Rector/Class_/ChangeReadOnlyVariableWithDefaultValueToConstantRector.php
578578
- rules/Privatization/Naming/ConstantNaming.php
579-
<<<<<<< HEAD
580-
<<<<<<< HEAD
581-
582579

583580
-
584581
message: '#Cannot cast array<string\>\|string\|null to string#'
585582
paths:
586583
- utils/compiler/src/Command/DowngradePathsCommand.php
587-
<<<<<<< HEAD
588584

589585
- '#Method Rector\\Testing\\Finder\\RectorsFinder\:\:findClassesInDirectoriesByName\(\) should return array<class\-string\> but returns array<int, string\>#'
590-
=======
591-
=======
592-
=======
593-
=======
594-
=======
595-
=======
596-
>>>>>>> 3086e35f6a... update for covariance
597-
598586
- '#Cannot cast array<string\>\|string\|null to string#'
599-
<<<<<<< HEAD
600-
<<<<<<< HEAD
601-
>>>>>>> ecbb522391... add test case stub
602-
>>>>>>> 26af319bc5... add test case stub
603-
<<<<<<< HEAD
604-
>>>>>>> 5e8e267c44... add test case stub
605-
<<<<<<< HEAD
606-
>>>>>>> cbf451db2b... add test case stub
607-
<<<<<<< HEAD
608-
>>>>>>> b8d9d6b850... add test case stub
609-
=======
610-
=======
611-
=======
612-
=======
613-
>>>>>>> ad3cb2c224... [CI] add PHP 7.1 versions too
614-
>>>>>>> 2572699c7c... [CI] add PHP 7.1 versions too
615-
>>>>>>> 16c4aab3cf... [CI] add PHP 7.1 versions too
616-
<<<<<<< HEAD
617-
>>>>>>> c49c7b31e9... [CI] add linter for php code
618-
=======
619-
=======
620-
>>>>>>> 3086e35f6a... update for covariance
621-
>>>>>>> 0aa962a0f2... update for covariance

rules/TypeDeclaration/AlreadyAssignDetector/ConstructorAssignDetector.php

+5-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
use PhpParser\Node\Stmt\Expression;
1313
use PhpParser\NodeTraverser;
1414
use Rector\Core\ValueObject\MethodName;
15-
use Rector\NodeTypeResolver\Node\AttributeKey;
1615
use Rector\TypeDeclaration\Matcher\PropertyAssignMatcher;
1716
use Symplify\Astral\NodeTraverser\SimpleCallableNodeTraverser;
1817

@@ -57,8 +56,11 @@ public function isPropertyAssigned(ClassLike $classLike, string $propertyName):
5756
}
5857
}
5958

60-
$this->simpleCallableNodeTraverser->traverseNodesWithCallable($constructClassMethod->stmts, function (Node $node) use (
61-
$propertyName, &$isAssignedInConstructor
59+
$this->simpleCallableNodeTraverser->traverseNodesWithCallable($constructClassMethod->stmts, function (
60+
Node $node
61+
) use (
62+
$propertyName,
63+
&$isAssignedInConstructor
6264
): ?int {
6365
$expr = $this->matchAssignExprToPropertyName($node, $propertyName);
6466
if (! $expr instanceof Expr) {

utils/compiler/src/Command/DowngradePathsCommand.php

-32
Original file line numberDiff line numberDiff line change
@@ -45,35 +45,18 @@ protected function execute(InputInterface $input, OutputInterface $output): int
4545

4646
$downgradePaths = array_values($downgradePaths);
4747

48-
<<<<<<< HEAD
49-
<<<<<<< HEAD
5048
$rulesPaths = $this->resolveRulesPaths();
5149
$downgradePaths = array_merge($downgradePaths, $rulesPaths);
5250

5351
// make symplify grouped into 1 directory, to make covariance downgrade work with all dependent classes
54-
=======
55-
$downgradePaths[] = 'src';
56-
=======
57-
>>>>>>> 3086e35f6a... update for covariance
58-
$downgradePaths[] = 'packages';
59-
6052
$rulesPaths = $this->resolveRulesPaths();
6153
$downgradePaths = array_merge($downgradePaths, $rulesPaths);
6254

63-
<<<<<<< HEAD
64-
// make symplify grouped into 1 directory, small enough
65-
>>>>>>> cbf451db2b... add test case stub
66-
=======
6755
// make symplify grouped into 1 directory, to make covariance downgrade work with all dependent classes
68-
>>>>>>> 3086e35f6a... update for covariance
6956
foreach ($downgradePaths as $key => $downgradePath) {
7057
if (Strings::startsWith($downgradePath, 'vendor/symplify')) {
7158
unset($downgradePaths[$key]);
7259
}
73-
<<<<<<< HEAD
74-
<<<<<<< HEAD
75-
=======
76-
>>>>>>> 3086e35f6a... update for covariance
7760

7861
if (Strings::startsWith($downgradePath, 'vendor/symfony')) {
7962
unset($downgradePaths[$key]);
@@ -86,7 +69,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int
8669
if (Strings::startsWith($downgradePath, 'vendor/psr')) {
8770
unset($downgradePaths[$key]);
8871
}
89-
<<<<<<< HEAD
9072
}
9173

9274
$downgradePaths = array_merge(['vendor/symplify vendor/symfony vendor/psr vendor/nikic src packages'],
@@ -96,21 +78,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
9678

9779
// bash format
9880
$downgradePathsLine = implode(';', $downgradePaths);
99-
=======
100-
=======
101-
>>>>>>> 3086e35f6a... update for covariance
102-
}
103-
104-
$downgradePaths = array_merge(['vendor/symplify vendor/symfony vendor/psr vendor/nikic src'], $downgradePaths);
105-
$downgradePaths = array_values($downgradePaths);
10681

107-
// bash format
108-
<<<<<<< HEAD
109-
$downgradePathsLine = implode(' ', $downgradePaths);
110-
>>>>>>> cbf451db2b... add test case stub
111-
=======
112-
$downgradePathsLine = implode(';', $downgradePaths);
113-
>>>>>>> 3086e35f6a... update for covariance
11482
echo $downgradePathsLine . PHP_EOL;
11583

11684
return ShellCode::SUCCESS;

0 commit comments

Comments
 (0)