Aggiornato Composer
This commit is contained in:
8
vendor/symfony/console/Input/InputOption.php
vendored
8
vendor/symfony/console/Input/InputOption.php
vendored
@@ -59,7 +59,7 @@ class InputOption
|
||||
*
|
||||
* @throws InvalidArgumentException If option mode is invalid or incompatible
|
||||
*/
|
||||
public function __construct(string $name, $shortcut = null, int $mode = null, string $description = '', $default = null)
|
||||
public function __construct(string $name, $shortcut = null, ?int $mode = null, string $description = '', $default = null)
|
||||
{
|
||||
if (str_starts_with($name, '--')) {
|
||||
$name = substr($name, 2);
|
||||
@@ -69,7 +69,7 @@ class InputOption
|
||||
throw new InvalidArgumentException('An option name cannot be empty.');
|
||||
}
|
||||
|
||||
if (empty($shortcut)) {
|
||||
if ('' === $shortcut || [] === $shortcut || false === $shortcut) {
|
||||
$shortcut = null;
|
||||
}
|
||||
|
||||
@@ -78,10 +78,10 @@ class InputOption
|
||||
$shortcut = implode('|', $shortcut);
|
||||
}
|
||||
$shortcuts = preg_split('{(\|)-?}', ltrim($shortcut, '-'));
|
||||
$shortcuts = array_filter($shortcuts);
|
||||
$shortcuts = array_filter($shortcuts, 'strlen');
|
||||
$shortcut = implode('|', $shortcuts);
|
||||
|
||||
if (empty($shortcut)) {
|
||||
if ('' === $shortcut) {
|
||||
throw new InvalidArgumentException('An option shortcut cannot be empty.');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user