-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #41 from Aeliot-Tm/fix-minors
Fix code style
- Loading branch information
Showing
3 changed files
with
15 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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]> | ||
* | ||
|
@@ -21,7 +21,7 @@ final class ConsoleOptionsReader | |
{ | ||
private string $rootDirectory; | ||
|
||
/** @var array<string, string> */ | ||
/** @var array<string, string> */ | ||
private array $option; | ||
|
||
public function __construct() | ||
|
@@ -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', ''); | ||
} | ||
|
||
/** | ||
|
@@ -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); | ||
} | ||
|
@@ -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)); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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; | ||
|