<?php
namespace Illuminate\Console;
use Illuminate\Support\Str;
use InvalidArgumentException;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
// my name space
class Parser
{
/**
* Parse the given console command definition into an array.
*
* @param string $expression
* @return array
*
* @throws \InvalidArgumentException
*/
public static function parse($expression)//Parse the given console command definition into array.
{
if (trim($expression) === '') {
throw new InvalidArgumentException('Console command definition is empty.');
}// trim the expression ,if have the null
// throw new
preg_match('/[^\s]+/', $expression, $matches);// get you want value in the big date.
if (isset($matches[0])) {
// is has the match value ,only get one
$name = $matches[0];// use the name to save the matches[0] value
} else {
每天laravel-20160719|Parser
最新推荐文章于 2024-05-22 13:18:25 发布