Skip to content

Commit 4f2a981

Browse files
committed
remove array item scope, as handled in array
1 parent 7556383 commit 4f2a981

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

rules/CodeQuality/Rector/Coalesce/CoalesceToTernaryRector.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@
44

55
namespace Rector\CodeQuality\Rector\Coalesce;
66

7-
use PHPStan\Type\UnionType;
8-
use PHPStan\Type\NullType;
97
use PhpParser\Node;
108
use PhpParser\Node\Expr\ArrayDimFetch;
119
use PhpParser\Node\Expr\BinaryOp\Coalesce;
1210
use PhpParser\Node\Expr\Ternary;
1311
use PHPStan\Type\ErrorType;
1412
use PHPStan\Type\MixedType;
13+
use PHPStan\Type\NullType;
14+
use PHPStan\Type\UnionType;
15+
use Rector\PHPStan\ScopeFetcher;
1516
use Rector\Rector\AbstractRector;
1617
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
1718
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
18-
use Rector\PHPStan\ScopeFetcher;
1919

2020
/**
2121
* @see \Rector\Tests\CodeQuality\Rector\Coalesce\CoalesceToTernaryRector\CoalesceToTernaryRectorTest

rules/Php85/Rector/ArrayDimFetch/ArrayFirstLastRector.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,6 @@ private function shouldSkip(ArrayDimFetch $arrayDimFetch, Node $scopeNode): bool
179179
if ($scope->isInExpressionAssign($arrayDimFetch)) {
180180
return true;
181181
}
182-
<<<<<<< HEAD
183182

184183
if ($arrayDimFetch->getAttribute(AttributeKey::IS_BEING_ASSIGNED) === true) {
185184
return true;
@@ -189,8 +188,6 @@ private function shouldSkip(ArrayDimFetch $arrayDimFetch, Node $scopeNode): bool
189188
return true;
190189
}
191190

192-
=======
193-
>>>>>>> ce85ccbfcc (fixup! [experiment] skip beforeTraverse() and afterTraverse() as never used)
194191
return (bool) $arrayDimFetch->getAttribute(AttributeKey::IS_UNSET_VAR);
195192
}
196193
}

src/Console/Command/WorkerCommand.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,12 @@ private function runWorker(
131131
$encoder->on(ReactEvent::ERROR, $handleErrorCallback);
132132

133133
// 2. collect diffs + errors from file processor
134-
$decoder->on(ReactEvent::DATA, function (array $json) use ($preFileCallback, $encoder, $configuration, $input): void {
134+
$decoder->on(ReactEvent::DATA, function (array $json) use (
135+
$preFileCallback,
136+
$encoder,
137+
$configuration,
138+
$input
139+
): void {
135140
$action = $json[ReactCommand::ACTION];
136141
if ($action !== Action::MAIN) {
137142
return;
@@ -154,7 +159,9 @@ private function runWorker(
154159
$encoder->write([
155160
ReactCommand::ACTION => Action::RESULT,
156161
self::RESULT => [
157-
Bridge::FILE_DIFFS => $processResult->getFileDiffs($input->getOption(Option::OUTPUT_FORMAT) !== 'json'),
162+
Bridge::FILE_DIFFS => $processResult->getFileDiffs(
163+
$input->getOption(Option::OUTPUT_FORMAT) !== 'json'
164+
),
158165
Bridge::FILES_COUNT => count($filePaths),
159166
Bridge::SYSTEM_ERRORS => $processResult->getSystemErrors(),
160167
Bridge::SYSTEM_ERRORS_COUNT => count($processResult->getSystemErrors()),

0 commit comments

Comments
 (0)