Skip to content

Commit

Permalink
Merge pull request #41 from Aeliot-Tm/fix-minors
Browse files Browse the repository at this point in the history
Fix code style
  • Loading branch information
Aeliot-Tm authored Oct 4, 2024
2 parents 96ab7c1 + 6a5c0b3 commit 09ac897
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion bin/pcsf-baseline
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ declare(strict_types=1);

use Aeliot\PhpCsFixerBaseline\Model\BuilderConfig;
use Aeliot\PhpCsFixerBaseline\Service\Builder;
use Aeliot\PhpCsFixerBaseline\Service\Saver;
use Aeliot\PhpCsFixerBaseline\Service\ConsoleOptionsReader;
use Aeliot\PhpCsFixerBaseline\Service\Saver;

$autoloaderPath = (static function (): string {
if (Phar::running()) {
Expand Down
10 changes: 5 additions & 5 deletions src/Service/ConsoleOptionsReader.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
declare(strict_types=1);

/*
* This file is part of the box project.
* This file is part of the PHP CS Fixer Baseline project.
*
* (c) Anatoliy Melnikov <[email protected]>
*
Expand All @@ -21,7 +21,7 @@ final class ConsoleOptionsReader
{
private string $rootDirectory;

/** @var array<string, string> */
/** @var array<string, string> */
private array $option;

public function __construct()
Expand All @@ -30,7 +30,7 @@ public function __construct()
'ab:c:d:f:w:',
['absolute', 'baseline:', 'config:', 'config-dir:', 'finder:', 'workdir:']
);
$this->rootDirectory = $this->getOptionValue('d','config-dir', '');
$this->rootDirectory = $this->getOptionValue('d', 'config-dir', '');
}

/**
Expand Down Expand Up @@ -77,7 +77,7 @@ private function getWorkdir(): ?string
return $this->getOptionValue('w', 'workdir', null);
}

private function getRelative(): ?bool
private function getRelative(): bool
{
return !$this->getOptionValue('a', 'relative', false);
}
Expand All @@ -93,7 +93,7 @@ private function getAbsolutePath(string $path): string
return getcwd() . '/' . $path;
}

private function getOptionValue(string $short, string $long, bool|null|string $default): bool|null|string
private function getOptionValue(string $short, string $long, bool|string|null $default): bool|string|null
{
if (\array_key_exists($short, $this->option) && \array_key_exists($long, $this->option)) {
throw new \InvalidArgumentException(sprintf('%s is duplicated', $long));
Expand Down
9 changes: 9 additions & 0 deletions tests/Unit/Functional/CommandLineTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@

declare(strict_types=1);

/*
* This file is part of the PHP CS Fixer Baseline project.
*
* (c) Anatoliy Melnikov <[email protected]>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/

namespace Aeliot\PhpCsFixerBaseline\Test\Unit\Functional;

use PHPUnit\Framework\Attributes\CoversNothing;
Expand Down

0 comments on commit 09ac897

Please sign in to comment.