diff options
| author | 2025-08-07 22:19:45 +0200 | |
|---|---|---|
| committer | 2025-08-07 22:19:45 +0200 | |
| commit | 62f32ccadff77594f5b8e3ad24c4c2541ff35885 (patch) | |
| tree | 29689e66fd16fcbeb385cda554890d45d66e58c2 /cli/CliOption.php | |
| parent | 149136fbe252cca4cb8dcdb463df135094bc0f87 (diff) | |
PHPStan: finalise strictArrayFilter (#7794)
As well as reportPossiblyNonexistentConstantArrayOffset.
And disable PHPStan-next from GitHub Action, since the work is completed for now.
Diffstat (limited to 'cli/CliOption.php')
| -rw-r--r-- | cli/CliOption.php | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/cli/CliOption.php b/cli/CliOption.php index e92fbd804..129d0de03 100644 --- a/cli/CliOption.php +++ b/cli/CliOption.php @@ -5,6 +5,7 @@ final class CliOption { public const VALUE_NONE = 'none'; public const VALUE_REQUIRED = 'required'; public const VALUE_OPTIONAL = 'optional'; + /** @var 'none'|'required'|'optional' $valueTaken */ private string $valueTaken = self::VALUE_REQUIRED; /** @var array{type:string,isArray:bool} $types */ private array $types = ['type' => 'string', 'isArray' => false]; @@ -61,6 +62,7 @@ final class CliOption { return $this; } + /** @return 'none'|'required'|'optional' */ public function getValueTaken(): string { return $this->valueTaken; } @@ -94,6 +96,6 @@ final class CliOption { $this->deprecatedAlias, ]; - return array_filter($aliases); + return array_filter($aliases, fn(?string $alias): bool => $alias !== null && trim($alias) !== ''); } } |
