Skip to content

Commit

Permalink
bot: fix cs [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
kbond committed Jan 16, 2024
1 parent bbfc9f4 commit 625ff6c
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion src/EventListener/CommandSummarySubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ protected function summarize(InputInterface $input, OutputInterface $output, int
{
$output->writeln(\sprintf(" // Duration: <info>%s</info>, Peak Memory: <info>%s</info>\n",
Helper::formatTime($duration),
Helper::formatMemory(\memory_get_peak_usage(true))
Helper::formatMemory(\memory_get_peak_usage(true)),
));
}
}
4 changes: 2 additions & 2 deletions src/Invokable.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ function(\ReflectionParameter $parameter) use ($input, $output) {
return Parameter::typed(
$type->getName(),
Parameter::factory(fn() => $this->argumentFactories[$type->getName()]($input, $output)),
Argument::EXACT
Argument::EXACT,
);
}

Expand Down Expand Up @@ -99,7 +99,7 @@ function(\ReflectionParameter $parameter) use ($input, $output) {
Parameter::typed(InputInterface::class, $input, Argument::EXACT),
Parameter::typed(OutputInterface::class, $output, Argument::EXACT),
Parameter::typed(IO::class, $this->io(), Argument::COVARIANCE),
Parameter::typed(IO::class, Parameter::factory(fn($class) => new $class($input, $output)))
Parameter::typed(IO::class, Parameter::factory(fn($class) => new $class($input, $output))),
);
},
self::invokeParameters(),
Expand Down
6 changes: 3 additions & 3 deletions src/InvokableServiceCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ static function(\ReflectionParameter $parameter) use ($supportsAttributes) {

return new SubscribedService('invoke:'.$parameter->name, $name, $type->allowsNull(), $attributes); // @phpstan-ignore-line
},
self::invokeParameters()
)
)
self::invokeParameters(),
),
),
);

return [...$services, ParameterBagInterface::class];
Expand Down
4 changes: 2 additions & 2 deletions src/RunsProcesses.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ protected function runProcess($process): Process
if (\mb_strlen($commandLine) > $maxLength) {
$commandLine = \sprintf('%s...%s',
\mb_substr($commandLine, 0, (int) \ceil($maxLength / 2)),
\mb_substr($commandLine, 0 - (int) \floor($maxLength / 2) - 3) // accommodate "..."
\mb_substr($commandLine, 0 - (int) \floor($maxLength / 2) - 3), // accommodate "..."
);
}

Expand All @@ -58,7 +58,7 @@ protected function runProcess($process): Process
$last = \sprintf('<%s>%s</%1$s> %s',
Process::ERR === $type ? 'error' : 'comment',
\mb_strtoupper($type),
$line
$line,
);

$this->io()->text($last);
Expand Down
2 changes: 1 addition & 1 deletion tests/Fixture/Command/ServiceCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function __invoke(
string $env,
LoggerInterface $logger,
?RouterInterface $router = null,
?Table $optional = null
?Table $optional = null,
): void {
$io->comment(\sprintf('IO: %s', \get_debug_type($io)));
$io->comment(\sprintf('InputInterface: %s', \get_debug_type($input)));
Expand Down
22 changes: 11 additions & 11 deletions tests/Unit/ConfigureWithAttributesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,11 @@ public static function getDefaultName(): ?string
}

public function __invoke(
#[Option] ?bool $foo
#[Option] ?bool $foo,
): void {
$this->io()->writeln(\sprintf('foo: %s', \var_export($foo, true)));
}
}
},
);

$command->execute()
Expand Down Expand Up @@ -174,12 +174,12 @@ public static function getDefaultName(): ?string

public function __invoke(
#[Argument('custom-foo')] ?string $foo,
#[Option('custom-bar')] bool $bar
#[Option('custom-bar')] bool $bar,
): void {
$this->io()->writeln(\sprintf('foo: %s', \var_export($foo, true)));
$this->io()->writeln(\sprintf('bar: %s', \var_export($bar, true)));
}
}
},
);

$command->execute()
Expand Down Expand Up @@ -212,7 +212,7 @@ public static function getDefaultName(): ?string
}

public function __invoke(
#[Argument(mode: InputArgument::REQUIRED)] $foo
#[Argument(mode: InputArgument::REQUIRED)] $foo,
): void {
}
};
Expand All @@ -235,7 +235,7 @@ public static function getDefaultName(): ?string
}

public function __invoke(
#[Argument(default: true)] $foo
#[Argument(default: true)] $foo,
): void {
}
};
Expand All @@ -258,7 +258,7 @@ public static function getDefaultName(): ?string
}

public function __invoke(
#[Option(mode: InputArgument::REQUIRED)] $foo
#[Option(mode: InputArgument::REQUIRED)] $foo,
): void {
}
};
Expand All @@ -281,7 +281,7 @@ public static function getDefaultName(): ?string
}

public function __invoke(
#[Option(default: true)] $foo
#[Option(default: true)] $foo,
): void {
}
};
Expand All @@ -306,7 +306,7 @@ public static function getDefaultName(): ?string
public function __invoke(
#[Option]
#[Option]
$foo
$foo,
): void {
}
};
Expand All @@ -331,7 +331,7 @@ public static function getDefaultName(): ?string
public function __invoke(
#[Argument]
#[Argument]
$foo
$foo,
): void {
}
};
Expand Down Expand Up @@ -378,7 +378,7 @@ public function __invoke(
string $option3 = 'default',

#[Option('option4', shortcut: 'o', description: 'Fourth option is an array with a shortcut (-o)')]
array $bar = []
array $bar = [],
) {
}
}
Expand Down
4 changes: 2 additions & 2 deletions tests/Unit/IOTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ public function argument_and_option_aliases(): void
$io = new IO(
new ArrayInput(
['foo' => 'bar', '--bar' => 'foobar'],
new InputDefinition([new InputArgument('foo'), new InputOption('bar')])
new InputDefinition([new InputArgument('foo'), new InputOption('bar')]),
),
new NullOutput()
new NullOutput(),
);

$this->assertSame('bar', $io->argument('foo'));
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/InvokableTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function __invoke(
string $arg2,
$opt1,
bool $opt2,
?string $optional = null
?string $optional = null,
) {
$io->comment(\sprintf('IO: %s', $io::class));
$io->comment(\sprintf('$this->io(): %s', \get_class($this->io())));
Expand Down

0 comments on commit 625ff6c

Please sign in to comment.