Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions rules/CodingStyle/Rector/FuncCall/StrictInArrayRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ public function __construct(
public function getRuleDefinition(): RuleDefinition
{
return new RuleDefinition(
'Set in_array strict to true when defined on similar type', [
new CodeSample(
<<<'CODE_SAMPLE'
'Set in_array strict to true when defined on similar type',
[
new CodeSample(
<<<'CODE_SAMPLE'
class BothStrings
{
public function run(string $value)
Expand All @@ -36,8 +37,8 @@ public function run(string $value)
}
}
CODE_SAMPLE
,
<<<'CODE_SAMPLE'
,
<<<'CODE_SAMPLE'
class BothStrings
{
public function run(string $value)
Expand All @@ -46,8 +47,8 @@ public function run(string $value)
}
}
CODE_SAMPLE
),
]
),
]
);
}

Expand Down
6 changes: 5 additions & 1 deletion rules/Php70/Rector/Ternary/TernaryToNullCoalescingRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,11 @@ private function processTernaryWithIsset(Ternary $ternary, Isset_ $isset): ?Coal
return null;
}

if (($ternary->else instanceof Ternary || $ternary->else instanceof BinaryOp) && $this->isTernaryParenthesized($this->file, $ternary->cond, $ternary)) {
if (($ternary->else instanceof Ternary || $ternary->else instanceof BinaryOp) && $this->isTernaryParenthesized(
$this->file,
$ternary->cond,
$ternary
)) {
$ternary->else->setAttribute(AttributeKey::WRAPPED_IN_PARENTHESES, true);
}

Expand Down
10 changes: 5 additions & 5 deletions rules/Php71/Rector/List_/ListToArrayDestructRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,11 @@ public function refactor(Node $node): ?Node
return $node;
}

public function provideMinPhpVersion(): int
{
return PhpVersionFeature::ARRAY_DESTRUCT;
}

private function hasPartialDestruct(List_ $list): bool
{
foreach ($list->items as $listItem) {
Expand All @@ -118,9 +123,4 @@ private function hasPartialDestruct(List_ $list): bool

return false;
}

public function provideMinPhpVersion(): int
{
return PhpVersionFeature::ARRAY_DESTRUCT;
}
}