Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7bbcaf3

Browse files
More CS fixes
1 parent 2f04c68 commit 7bbcaf3

4 files changed

Lines changed: 44 additions & 39 deletions

File tree

Command/TraceableCommand.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,7 @@ public function __construct(
6262
parent::__construct($command->getName());
6363

6464
// init below enables calling {@see parent::run()}
65-
[$code, $processTitle, $ignoreValidationErrors] = \Closure::bind(function () {
66-
return [$this->code, $this->processTitle, $this->ignoreValidationErrors];
67-
}, $command, Command::class)();
65+
[$code, $processTitle, $ignoreValidationErrors] = \Closure::bind(fn () => [$this->code, $this->processTitle, $this->ignoreValidationErrors], $command, Command::class)();
6866

6967
if (\is_callable($code)) {
7068
$this->setCode($code);

Input/ArgvInput.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,8 @@ private function parseShortOptionSet(string $name): void
130130
$this->addLongOption($option->getName(), $i === $len - 1 ? null : substr($name, $i + 1));
131131

132132
break;
133-
} else {
134-
$this->addLongOption($option->getName(), null);
135133
}
134+
$this->addLongOption($option->getName(), null);
136135
}
137136
}
138137

Output/AnsiColorMode.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,11 @@ private function degradeHexColorToAnsi8(int $r, int $g, int $b): int
9696
}
9797

9898
return (int) round(($r - 8) / 247 * 24) + 232;
99-
} else {
100-
return 16 +
101-
(36 * (int) round($r / 255 * 5)) +
102-
(6 * (int) round($g / 255 * 5)) +
103-
(int) round($b / 255 * 5);
10499
}
100+
101+
return 16 +
102+
(36 * (int) round($r / 255 * 5)) +
103+
(6 * (int) round($g / 255 * 5)) +
104+
(int) round($b / 255 * 5);
105105
}
106106
}

Tests/Formatter/OutputFormatterTest.php

Lines changed: 37 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -306,51 +306,59 @@ public function testContentWithLineBreaks()
306306
{
307307
$formatter = new OutputFormatter(true);
308308

309-
$this->assertEquals(<<<EOF
310-
\033[32m
311-
some text\033[39m
312-
EOF
313-
, $formatter->format(<<<'EOF'
309+
$this->assertEquals(
310+
<<<EOF
311+
\033[32m
312+
some text\033[39m
313+
EOF,
314+
$formatter->format(<<<'EOF'
314315
<info>
315316
some text</info>
316317
EOF
317-
));
318+
)
319+
);
318320

319-
$this->assertEquals(<<<EOF
320-
\033[32msome text
321-
\033[39m
322-
EOF
323-
, $formatter->format(<<<'EOF'
321+
$this->assertEquals(
322+
<<<EOF
323+
\033[32msome text
324+
\033[39m
325+
EOF,
326+
$formatter->format(<<<'EOF'
324327
<info>some text
325328
</info>
326329
EOF
327-
));
328-
329-
$this->assertEquals(<<<EOF
330-
\033[32m
331-
some text
332-
\033[39m
333-
EOF
334-
, $formatter->format(<<<'EOF'
330+
)
331+
);
332+
333+
$this->assertEquals(
334+
<<<EOF
335+
\033[32m
336+
some text
337+
\033[39m
338+
EOF,
339+
$formatter->format(<<<'EOF'
335340
<info>
336341
some text
337342
</info>
338343
EOF
339-
));
340-
341-
$this->assertEquals(<<<EOF
342-
\033[32m
343-
some text
344-
more text
345-
\033[39m
346-
EOF
347-
, $formatter->format(<<<'EOF'
344+
)
345+
);
346+
347+
$this->assertEquals(
348+
<<<EOF
349+
\033[32m
350+
some text
351+
more text
352+
\033[39m
353+
EOF,
354+
$formatter->format(<<<'EOF'
348355
<info>
349356
some text
350357
more text
351358
</info>
352359
EOF
353-
));
360+
)
361+
);
354362
}
355363

356364
public function testFormatAndWrap()

0 commit comments

Comments
 (0)