Mercurial > hg > isophonics-drupal-site
diff vendor/symfony/console/Input/StringInput.php @ 17:129ea1e6d783
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:21:36 +0000 |
parents | 1fec387a4317 |
children |
line wrap: on
line diff
--- a/vendor/symfony/console/Input/StringInput.php Tue Jul 10 15:07:59 2018 +0100 +++ b/vendor/symfony/console/Input/StringInput.php Thu Feb 28 13:21:36 2019 +0000 @@ -32,7 +32,7 @@ */ public function __construct($input) { - parent::__construct(array()); + parent::__construct([]); $this->setTokens($this->tokenize($input)); } @@ -48,15 +48,15 @@ */ private function tokenize($input) { - $tokens = array(); - $length = strlen($input); + $tokens = []; + $length = \strlen($input); $cursor = 0; while ($cursor < $length) { if (preg_match('/\s+/A', $input, $match, null, $cursor)) { } elseif (preg_match('/([^="\'\s]+?)(=?)('.self::REGEX_QUOTED_STRING.'+)/A', $input, $match, null, $cursor)) { - $tokens[] = $match[1].$match[2].stripcslashes(str_replace(array('"\'', '\'"', '\'\'', '""'), '', substr($match[3], 1, strlen($match[3]) - 2))); + $tokens[] = $match[1].$match[2].stripcslashes(str_replace(['"\'', '\'"', '\'\'', '""'], '', substr($match[3], 1, \strlen($match[3]) - 2))); } elseif (preg_match('/'.self::REGEX_QUOTED_STRING.'/A', $input, $match, null, $cursor)) { - $tokens[] = stripcslashes(substr($match[0], 1, strlen($match[0]) - 2)); + $tokens[] = stripcslashes(substr($match[0], 1, \strlen($match[0]) - 2)); } elseif (preg_match('/'.self::REGEX_STRING.'/A', $input, $match, null, $cursor)) { $tokens[] = stripcslashes($match[1]); } else { @@ -64,7 +64,7 @@ throw new InvalidArgumentException(sprintf('Unable to parse input near "... %s ..."', substr($input, $cursor, 10))); } - $cursor += strlen($match[0]); + $cursor += \strlen($match[0]); } return $tokens;