Skip to content

Commit a7598ad

Browse files
[automated] Apply Coding Standard (#7102)
* [automated] Apply Coding Standard * Fix --------- Co-authored-by: TomasVotruba <924196+TomasVotruba@users.noreply.github.com> Co-authored-by: Abdul Malik Ikhsan <samsonasik@gmail.com>
1 parent fa0a9a8 commit a7598ad

3 files changed

Lines changed: 10 additions & 8 deletions

File tree

composer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@
6363
},
6464
"replace": {
6565
"rector/rector": "self.version",
66-
"symfony/string": "*",
6766
"symfony/polyfill-ctype": "*",
6867
"symfony/polyfill-intl-grapheme": "*"
6968
},

rules/Transform/Rector/ArrayDimFetch/ArrayDimFetchToMethodCallRector.php

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
namespace Rector\Transform\Rector\ArrayDimFetch;
66

77
use PhpParser\Node;
8-
use PhpParser\NodeVisitor;
98
use PhpParser\Node\Arg;
109
use PhpParser\Node\Expr;
1110
use PhpParser\Node\Expr\ArrayDimFetch;
@@ -14,10 +13,11 @@
1413
use PhpParser\Node\Expr\BinaryOp\BooleanAnd;
1514
use PhpParser\Node\Expr\Isset_;
1615
use PhpParser\Node\Expr\MethodCall;
17-
use PHPStan\Type\ObjectType;
1816
use PhpParser\Node\Stmt;
1917
use PhpParser\Node\Stmt\Expression;
2018
use PhpParser\Node\Stmt\Unset_;
19+
use PhpParser\NodeVisitor;
20+
use PHPStan\Type\ObjectType;
2121
use Rector\Contract\Rector\ConfigurableRectorInterface;
2222
use Rector\Rector\AbstractRector;
2323
use Rector\Transform\ValueObject\ArrayDimFetchToMethodCall;
@@ -83,7 +83,7 @@ public function refactor(Node $node): array|Expr|null|int
8383
}
8484

8585
if ($node instanceof Assign) {
86-
if (!$node->var instanceof ArrayDimFetch) {
86+
if (! $node->var instanceof ArrayDimFetch) {
8787
return null;
8888
}
8989

@@ -130,7 +130,10 @@ private function handleIsset(Isset_ $isset): Expr|int|null
130130

131131
return array_reduce(
132132
$exprs,
133-
fn (?Expr $carry, Expr $expr): Isset_|MethodCall|BooleanAnd => $carry instanceof Expr ? new BooleanAnd($carry, $expr) : $expr,
133+
fn (?Expr $carry, Expr $expr): Isset_|MethodCall|BooleanAnd => $carry instanceof Expr ? new BooleanAnd(
134+
$carry,
135+
$expr
136+
) : $expr,
134137
null,
135138
);
136139
}
@@ -173,12 +176,12 @@ private function handleUnset(Unset_ $unset): array|int
173176
*/
174177
private function getMethodCall(ArrayDimFetch $arrayDimFetch, string $action, ?Expr $expr = null): ?MethodCall
175178
{
176-
if (!$arrayDimFetch->dim instanceof Node) {
179+
if (! $arrayDimFetch->dim instanceof Node) {
177180
return null;
178181
}
179182

180183
foreach ($this->arrayDimFetchToMethodCalls as $arrayDimFetchToMethodCall) {
181-
if (!$this->isObjectType($arrayDimFetch->var, $arrayDimFetchToMethodCall->getObjectType())) {
184+
if (! $this->isObjectType($arrayDimFetch->var, $arrayDimFetchToMethodCall->getObjectType())) {
182185
continue;
183186
}
184187

src/NodeTypeResolver/NodeTypeResolver/ScalarTypeResolver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
use Rector\NodeTypeResolver\Contract\NodeTypeResolverInterface;
2222

2323
/**
24-
* @implements NodeTypeResolverInterface<Scalar>
24+
* @implements NodeTypeResolverInterface<scalar>
2525
*/
2626
final class ScalarTypeResolver implements NodeTypeResolverInterface
2727
{

0 commit comments

Comments
 (0)