Skip to content

Commit

Permalink
[rector] Apply fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rector-bot committed Sep 27, 2022
1 parent a34438f commit 57ef54c
Show file tree
Hide file tree
Showing 10 changed files with 7 additions and 40 deletions.
5 changes: 1 addition & 4 deletions src/CommandLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@

final class CommandLoader implements CommandLoaderInterface
{
private ContainerInterface $container;

/**
* @psalm-var array<string, array{
* name: non-empty-string,
Expand All @@ -38,9 +36,8 @@ final class CommandLoader implements CommandLoaderInterface
*
* @psalm-param array<string, class-string> $commandMap
*/
public function __construct(ContainerInterface $container, array $commandMap)
public function __construct(private ContainerInterface $container, array $commandMap)
{
$this->container = $container;
$this->setCommandMap($commandMap);
}

Expand Down
7 changes: 2 additions & 5 deletions src/ErrorListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,8 @@

final class ErrorListener
{
private LoggerInterface $logger;

public function __construct(LoggerInterface $logger)
public function __construct(private LoggerInterface $logger)
{
$this->logger = $logger;
}

/**
Expand All @@ -31,7 +28,7 @@ public function onError(ConsoleErrorEvent $event): void

$message = sprintf(
'%s: %s in %s:%s while running console command "%s".',
get_class($exception),
$exception::class,
$exception->getMessage(),
$exception->getFile(),
$exception->getLine(),
Expand Down
5 changes: 1 addition & 4 deletions src/Event/ApplicationShutdown.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,8 @@

final class ApplicationShutdown
{
private int $exitCode;

public function __construct(int $exitCode)
public function __construct(private int $exitCode)
{
$this->exitCode = $exitCode;
}

public function getExitCode(): int
Expand Down
2 changes: 0 additions & 2 deletions src/Output/ConsoleBufferedOutput.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ final class ConsoleBufferedOutput extends ConsoleOutput
/**
* Returns buffer content optionally clearing it.
*
* @param bool $clearBuffer
*
* @return string
*/
public function fetch(bool $clearBuffer = false): string
{
Expand Down
5 changes: 1 addition & 4 deletions src/SymfonyEventDispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,8 @@

final class SymfonyEventDispatcher implements EventDispatcherInterface
{
private PsrEventDispatcherInterface $dispatcher;

public function __construct(PsrEventDispatcherInterface $dispatcher)
public function __construct(private PsrEventDispatcherInterface $dispatcher)
{
$this->dispatcher = $dispatcher;
}

/**
Expand Down
4 changes: 0 additions & 4 deletions tests/ApplicationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,6 @@ public function namespaceProvider(): array

/**
* @dataProvider namespaceProvider
*
* @param string $name
* @param int|null $limit
* @param string $expected
*/
public function testExtractNamespace(string $name, ?int $limit, string $expected): void
{
Expand Down
3 changes: 0 additions & 3 deletions tests/ExitCodeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ public function reasons(): array

/**
* @dataProvider reasons
*
* @param string $errorMessage
* @param int $reason
*/
public function testGetReason(string $errorMessage, int $reason): void
{
Expand Down
5 changes: 1 addition & 4 deletions tests/Stub/ErrorCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,8 @@ final class ErrorCommand extends Command
protected static $defaultName = 'error';
protected static $defaultDescription = 'Error command tests';

private NonExistsClass $class;

public function __construct(NonExistsClass $class)
public function __construct(private NonExistsClass $class)
{
$this->class = $class;
parent::__construct();
}

Expand Down
6 changes: 1 addition & 5 deletions tests/Stub/StubCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@

final class StubCommand extends Command
{
private Application $application;

protected static $defaultName = 'stub';
protected static $defaultDescription = 'Stub command tests';

Expand All @@ -24,10 +22,8 @@ public function configure(): void
$this->addOption('styled', 's', InputOption::VALUE_OPTIONAL);
}

public function __construct(Application $application)
public function __construct(private Application $application)
{
$this->application = $application;

parent::__construct();
}

Expand Down
5 changes: 0 additions & 5 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ protected function application(): Application
/**
* Gets an inaccessible object property.
*
* @param object $object
* @param string $propertyName
*
* @return mixed
*/
Expand All @@ -80,9 +78,6 @@ protected function getInaccessibleProperty(object $object, string $propertyName)
/**
* Invokes an inaccessible method.
*
* @param object $object
* @param string $method
* @param array $args
*
* @throws ReflectionException
*
Expand Down

0 comments on commit 57ef54c

Please sign in to comment.