Skip to content

Commit da79e9b

Browse files
authored
[automated] Apply Coding Standard (#7922)
Co-authored-by: TomasVotruba <924196+TomasVotruba@users.noreply.github.com>
1 parent dfb760f commit da79e9b

File tree

3 files changed

+18
-13
lines changed

3 files changed

+18
-13
lines changed

rules/CodingStyle/Rector/FuncCall/StrictInArrayRector.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,10 @@ public function __construct(
2525
public function getRuleDefinition(): RuleDefinition
2626
{
2727
return new RuleDefinition(
28-
'Set in_array strict to true when defined on similar type', [
29-
new CodeSample(
30-
<<<'CODE_SAMPLE'
28+
'Set in_array strict to true when defined on similar type',
29+
[
30+
new CodeSample(
31+
<<<'CODE_SAMPLE'
3132
class BothStrings
3233
{
3334
public function run(string $value)
@@ -36,8 +37,8 @@ public function run(string $value)
3637
}
3738
}
3839
CODE_SAMPLE
39-
,
40-
<<<'CODE_SAMPLE'
40+
,
41+
<<<'CODE_SAMPLE'
4142
class BothStrings
4243
{
4344
public function run(string $value)
@@ -46,8 +47,8 @@ public function run(string $value)
4647
}
4748
}
4849
CODE_SAMPLE
49-
),
50-
]
50+
),
51+
]
5152
);
5253
}
5354

rules/Php70/Rector/Ternary/TernaryToNullCoalescingRector.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,11 @@ private function processTernaryWithIsset(Ternary $ternary, Isset_ $isset): ?Coal
115115
return null;
116116
}
117117

118-
if (($ternary->else instanceof Ternary || $ternary->else instanceof BinaryOp) && $this->isTernaryParenthesized($this->file, $ternary->cond, $ternary)) {
118+
if (($ternary->else instanceof Ternary || $ternary->else instanceof BinaryOp) && $this->isTernaryParenthesized(
119+
$this->file,
120+
$ternary->cond,
121+
$ternary
122+
)) {
119123
$ternary->else->setAttribute(AttributeKey::WRAPPED_IN_PARENTHESES, true);
120124
}
121125

rules/Php71/Rector/List_/ListToArrayDestructRector.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,11 @@ public function refactor(Node $node): ?Node
108108
return $node;
109109
}
110110

111+
public function provideMinPhpVersion(): int
112+
{
113+
return PhpVersionFeature::ARRAY_DESTRUCT;
114+
}
115+
111116
private function hasPartialDestruct(List_ $list): bool
112117
{
113118
foreach ($list->items as $listItem) {
@@ -118,9 +123,4 @@ private function hasPartialDestruct(List_ $list): bool
118123

119124
return false;
120125
}
121-
122-
public function provideMinPhpVersion(): int
123-
{
124-
return PhpVersionFeature::ARRAY_DESTRUCT;
125-
}
126126
}

0 commit comments

Comments
 (0)