The expression return $value could return the type null|string[] which is incompatible with the type-hinted return string. Consider adding an additional type-check to rule them out.
Loading history...
20
}
21
22
public static function getOption(InputInterface $input, string $optionName): ?string
23
{
24
$value = $input->getOption($optionName);
25
26
if (null === $value) {
27
return null;
28
}
29
30
Assert::string($value);
31
32
return $value;
33
}
34
35
public static function getOptionWithDefaultValue(InputInterface $input, string $optionName): string
The expression return $value could return the type null which is incompatible with the type-hinted return string. Consider adding an additional type-check to rule them out.
Loading history...
41
}
42
43
/**
44
* Returns STDIN as a string.
45
*
46
* @throws SarbException
47
*/
48
public static function getStdin(InputInterface $input): string
49
{
50
// If testing this will get input added by `CommandTester::setInputs` method.