upgrade to laravel 7 and set branch to v2
This commit is contained in:
+9
-19
@@ -67,7 +67,7 @@ class InputDefinition
|
||||
*
|
||||
* @param InputArgument[] $arguments An array of InputArgument objects
|
||||
*/
|
||||
public function setArguments($arguments = [])
|
||||
public function setArguments(array $arguments = [])
|
||||
{
|
||||
$this->arguments = [];
|
||||
$this->requiredCount = 0;
|
||||
@@ -81,7 +81,7 @@ class InputDefinition
|
||||
*
|
||||
* @param InputArgument[] $arguments An array of InputArgument objects
|
||||
*/
|
||||
public function addArguments($arguments = [])
|
||||
public function addArguments(?array $arguments = [])
|
||||
{
|
||||
if (null !== $arguments) {
|
||||
foreach ($arguments as $argument) {
|
||||
@@ -204,7 +204,7 @@ class InputDefinition
|
||||
*
|
||||
* @param InputOption[] $options An array of InputOption objects
|
||||
*/
|
||||
public function setOptions($options = [])
|
||||
public function setOptions(array $options = [])
|
||||
{
|
||||
$this->options = [];
|
||||
$this->shortcuts = [];
|
||||
@@ -216,7 +216,7 @@ class InputDefinition
|
||||
*
|
||||
* @param InputOption[] $options An array of InputOption objects
|
||||
*/
|
||||
public function addOptions($options = [])
|
||||
public function addOptions(array $options = [])
|
||||
{
|
||||
foreach ($options as $option) {
|
||||
$this->addOption($option);
|
||||
@@ -251,13 +251,11 @@ class InputDefinition
|
||||
/**
|
||||
* Returns an InputOption by name.
|
||||
*
|
||||
* @param string $name The InputOption name
|
||||
*
|
||||
* @return InputOption A InputOption object
|
||||
*
|
||||
* @throws InvalidArgumentException When option given doesn't exist
|
||||
*/
|
||||
public function getOption($name)
|
||||
public function getOption(string $name)
|
||||
{
|
||||
if (!$this->hasOption($name)) {
|
||||
throw new InvalidArgumentException(sprintf('The "--%s" option does not exist.', $name));
|
||||
@@ -272,11 +270,9 @@ class InputDefinition
|
||||
* This method can't be used to check if the user included the option when
|
||||
* executing the command (use getOption() instead).
|
||||
*
|
||||
* @param string $name The InputOption name
|
||||
*
|
||||
* @return bool true if the InputOption object exists, false otherwise
|
||||
*/
|
||||
public function hasOption($name)
|
||||
public function hasOption(string $name)
|
||||
{
|
||||
return isset($this->options[$name]);
|
||||
}
|
||||
@@ -294,11 +290,9 @@ class InputDefinition
|
||||
/**
|
||||
* Returns true if an InputOption object exists by shortcut.
|
||||
*
|
||||
* @param string $name The InputOption shortcut
|
||||
*
|
||||
* @return bool true if the InputOption object exists, false otherwise
|
||||
*/
|
||||
public function hasShortcut($name)
|
||||
public function hasShortcut(string $name)
|
||||
{
|
||||
return isset($this->shortcuts[$name]);
|
||||
}
|
||||
@@ -306,11 +300,9 @@ class InputDefinition
|
||||
/**
|
||||
* Gets an InputOption by shortcut.
|
||||
*
|
||||
* @param string $shortcut The Shortcut name
|
||||
*
|
||||
* @return InputOption An InputOption object
|
||||
*/
|
||||
public function getOptionForShortcut($shortcut)
|
||||
public function getOptionForShortcut(string $shortcut)
|
||||
{
|
||||
return $this->getOption($this->shortcutToName($shortcut));
|
||||
}
|
||||
@@ -349,11 +341,9 @@ class InputDefinition
|
||||
/**
|
||||
* Gets the synopsis.
|
||||
*
|
||||
* @param bool $short Whether to return the short version (with options folded) or not
|
||||
*
|
||||
* @return string The synopsis
|
||||
*/
|
||||
public function getSynopsis($short = false)
|
||||
public function getSynopsis(bool $short = false)
|
||||
{
|
||||
$elements = [];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user