12 namespace Symfony\Component\Console\Input;
28 const REGEX_QUOTED_STRING =
'(?:"([^"\\\\]*(?:\\\\.[^"\\\\]*)*)"|\'([^\'\\\\]*(?:\\\\.[^\'\\\\]*)*)\')';
43 @trigger_error(
'The $definition argument of the '.__METHOD__.
' method is deprecated and will be removed in 3.0. Set this parameter with the bind() method instead.', E_USER_DEPRECATED);
46 parent::__construct(array(), null);
67 $length = strlen($input);
69 while ($cursor < $length) {
70 if (preg_match(
'/\s+/A', $input, $match, null, $cursor)) {
71 }
elseif (preg_match(
'/([^="\'\s]+?)(=?)('.self::REGEX_QUOTED_STRING.
'+)/A', $input, $match, null, $cursor)) {
72 $tokens[] = $match[1].$match[2].stripcslashes(str_replace(array(
'"\'',
'\'"', '\'\'', '""'), '', substr($match[3], 1, strlen($match[3]) - 2)));
73 } elseif (preg_match('/'.self::REGEX_QUOTED_STRING.'/A', $input, $match, null, $cursor)) {
74 $tokens[] = stripcslashes(substr($match[0], 1, strlen($match[0]) - 2));
75 } elseif (preg_match('/'.self::REGEX_STRING.'/A', $input, $match, null, $cursor)) {
76 $tokens[] = stripcslashes($match[1]);
78 // should never happen
79 throw new \InvalidArgumentException(sprintf('Unable to parse input near "... %s ...
"', substr($input, $cursor, 10)));
82 $cursor += strlen($match[0]);