diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 285e24f..085685d 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -1,5 +1,5 @@ parameters: - level: 6 + level: 10 paths: - src tmpDir: build/phpstan diff --git a/src/Command.php b/src/Command.php index 9a14fb2..5251160 100644 --- a/src/Command.php +++ b/src/Command.php @@ -361,6 +361,9 @@ protected function validateDefinitions(array $definitions, array $values, string continue; } $type = $definition['type'] ?? 'string'; + if (!\is_string($type)) { + $type = 'string'; + } if ($type === 'string' || !\is_string($value)) { continue; } diff --git a/src/Commands/Help.php b/src/Commands/Help.php index b03b6ab..90493ee 100644 --- a/src/Commands/Help.php +++ b/src/Commands/Help.php @@ -106,8 +106,8 @@ protected function showCommand(string $commandName) : void protected function sortOptions(string $text) : string { - $text = \trim(\preg_replace('/\s+/', '', $text)); - $text = \explode(',', $text); + $cleaned = \preg_replace('/\s+/', '', $text); + $text = \explode(',', \is_string($cleaned) ? $cleaned : ''); \sort($text); return \implode(',', $text); }