public function defaults(array $defaults = [])
    {
        $definition = $this->getDefinition();

        foreach ($defaults as $name => $default) {
            if ($definition->hasArgument($name)) {
                $input = $definition->getArgument($name);
            } elseif ($definition->hasOption($name)) {
                $input = $definition->getOption($name);
            } else {
                throw new \InvalidArgumentException(
                    "Unable to set default for [{$name}]. It does not exist as an argument or option."
                );
            }

            $input->setDefault($default);
        }

        return $this;
    }
public function defaults(array $defaults = [])
    {
        $definition = $this->getDefinition();

        foreach ($defaults as $name => $default) {
            if ($definition->hasArgument($name)) {
                $input = $definition->getArgument($name);
            } elseif ($definition->hasOption($name)) {
                $input = $definition->getOption($name);
            } else {
                throw new \InvalidArgumentException(
                    "Unable to set default for [{$name}]. It does not exist as an argument or option."
                );
            }

            $input->setDefault($default);
        }

        return $this;
    }
public function defaults ( array $ defaults = [ ] ) { $ definition = $ this -> getDefinition ( ) ; foreach ( $ defaults as $ name => $ default ) { if ( $ definition -> hasArgument ( $ name ) ) { $ input = $ definition -> getArgument ( $ name ) ; } elseif ( $ definition -> hasOption ( $ name ) ) { $ input = $ definition -> getOption ( $ name ) ; } else { throw new \ InvalidArgumentException ( "Unable to set default for [{$name}]. It does not exist as an argument or option." ) ; } $ input -> setDefault ( $ default ) ; } return $ this ; }
Define default values for the arguments of the command.

@param array $defaults Default argument values.

@return $this

@api
Define default values for the arguments of the command .