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

Skip to content

Commit 412cf75

Browse files
CS fixes
1 parent 8a2628d commit 412cf75

5 files changed

Lines changed: 7 additions & 8 deletions

File tree

DependencyInjection/AddConsoleCommandPass.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function process(ContainerBuilder $container)
5555
if (!$r->isSubclassOf(Command::class)) {
5656
throw new InvalidArgumentException(sprintf('The service "%s" tagged "%s" must be a subclass of "%s".', $id, $this->commandTag, Command::class));
5757
}
58-
$commandName = $class::getDefaultName() !== null ? str_replace('%', '%%', $class::getDefaultName()) : null;
58+
$commandName = null !== $class::getDefaultName() ? str_replace('%', '%%', $class::getDefaultName()) : null;
5959
}
6060

6161
if (null === $commandName) {

Helper/Table.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,7 @@ private function fillNextRows(array $rows, int $line): array
641641
{
642642
$unmergedRows = [];
643643
foreach ($rows[$line] as $column => $cell) {
644-
if (null !== $cell && !$cell instanceof TableCell && !is_scalar($cell) && !(\is_object($cell) && method_exists($cell, '__toString'))) {
644+
if (null !== $cell && !$cell instanceof TableCell && !\is_scalar($cell) && !(\is_object($cell) && method_exists($cell, '__toString'))) {
645645
throw new InvalidArgumentException(sprintf('A cell must be a TableCell, a scalar or an object implementing "__toString()", "%s" given.', \gettype($cell)));
646646
}
647647
if ($cell instanceof TableCell && $cell->getRowspan() > 1) {

Logger/ConsoleLogger.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ private function interpolate(string $message, array $context): string
110110

111111
$replacements = [];
112112
foreach ($context as $key => $val) {
113-
if (null === $val || is_scalar($val) || (\is_object($val) && method_exists($val, '__toString'))) {
113+
if (null === $val || \is_scalar($val) || (\is_object($val) && method_exists($val, '__toString'))) {
114114
$replacements["{{$key}}"] = $val;
115115
} elseif ($val instanceof \DateTimeInterface) {
116116
$replacements["{{$key}}"] = $val->format(\DateTime::RFC3339);

Style/SymfonyStyle.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -430,18 +430,18 @@ private function autoPrependBlock(): void
430430
$chars = substr(str_replace(\PHP_EOL, "\n", $this->bufferedOutput->fetch()), -2);
431431

432432
if (!isset($chars[0])) {
433-
$this->newLine(); //empty history, so we should start with a new line.
433+
$this->newLine(); // empty history, so we should start with a new line.
434434

435435
return;
436436
}
437-
//Prepend new line for each non LF chars (This means no blank line was output before)
437+
// Prepend new line for each non LF chars (This means no blank line was output before)
438438
$this->newLine(2 - substr_count($chars, "\n"));
439439
}
440440

441441
private function autoPrependText(): void
442442
{
443443
$fetched = $this->bufferedOutput->fetch();
444-
//Prepend new line if last char isn't EOL:
444+
// Prepend new line if last char isn't EOL:
445445
if (!str_ends_with($fetched, "\n")) {
446446
$this->newLine();
447447
}

Tests/Tester/CommandTesterTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,7 @@ public function testErrorOutput()
217217
$command->addArgument('foo');
218218
$command->setCode(function ($input, $output) {
219219
$output->getErrorOutput()->write('foo');
220-
}
221-
);
220+
});
222221

223222
$tester = new CommandTester($command);
224223
$tester->execute(

0 commit comments

Comments
 (0)