protected static function name($expression)
    {
        if (trim($expression) === '') {
            throw new InvalidArgumentException('Console command definition is empty.');
        }

        if (! preg_match('/[^\s]+/', $expression, $matches)) {
            throw new InvalidArgumentException('Unable to determine command name from signature.');
        }

        return $matches[0];
    }
protected static function name($expression)
    {
        if (trim($expression) === '') {
            throw new InvalidArgumentException('Console command definition is empty.');
        }

        if (! preg_match('/[^\s]+/', $expression, $matches)) {
            throw new InvalidArgumentException('Unable to determine command name from signature.');
        }

        return $matches[0];
    }
protected static function name ( $ expression ) { if ( trim ( $ expression ) === '' ) { throw new InvalidArgumentException ( 'Console command definition is empty.' ) ; } if ( ! preg_match ( '/[^\s]+/' , $ expression , $ matches ) ) { throw new InvalidArgumentException ( 'Unable to determine command name from signature.' ) ; } return $ matches [ 0 ] ; }
Extract the name of the command from the expression.

@param  string  $expression
@return string

@throws \InvalidArgumentException
Extract the name of the command from the expression .