comparison vendor/psy/psysh/src/Input/ShellInput.php @ 16:c2387f117808

Routine composer update
author Chris Cannam
date Tue, 10 Jul 2018 15:07:59 +0100
parents 5fb285c0d0e3
children 129ea1e6d783
comparison
equal deleted inserted replaced
15:e200cb7efeb3 16:c2387f117808
103 stripcslashes($match[1]), 103 stripcslashes($match[1]),
104 stripcslashes(substr($input, $cursor)), 104 stripcslashes(substr($input, $cursor)),
105 ]; 105 ];
106 } else { 106 } else {
107 // should never happen 107 // should never happen
108 // @codeCoverageIgnoreStart
108 throw new \InvalidArgumentException(sprintf('Unable to parse input near "... %s ..."', substr($input, $cursor, 10))); 109 throw new \InvalidArgumentException(sprintf('Unable to parse input near "... %s ..."', substr($input, $cursor, 10)));
110 // @codeCoverageIgnoreEnd
109 } 111 }
110 112
111 $cursor += strlen($match[0]); 113 $cursor += strlen($match[0]);
112 } 114 }
113 115
166 } 168 }
167 169
168 return; 170 return;
169 } 171 }
170 172
173 // (copypasta)
174 //
175 // @codeCoverageIgnoreStart
176
171 // if last argument isArray(), append token to last argument 177 // if last argument isArray(), append token to last argument
172 if ($this->definition->hasArgument($c - 1) && $this->definition->getArgument($c - 1)->isArray()) { 178 if ($this->definition->hasArgument($c - 1) && $this->definition->getArgument($c - 1)->isArray()) {
173 $arg = $this->definition->getArgument($c - 1); 179 $arg = $this->definition->getArgument($c - 1);
174 $this->arguments[$arg->getName()][] = $token; 180 $this->arguments[$arg->getName()][] = $token;
175 181
181 if (count($all)) { 187 if (count($all)) {
182 throw new \RuntimeException(sprintf('Too many arguments, expected arguments "%s".', implode('" "', array_keys($all)))); 188 throw new \RuntimeException(sprintf('Too many arguments, expected arguments "%s".', implode('" "', array_keys($all))));
183 } 189 }
184 190
185 throw new \RuntimeException(sprintf('No arguments expected, got "%s".', $token)); 191 throw new \RuntimeException(sprintf('No arguments expected, got "%s".', $token));
192 // @codeCoverageIgnoreEnd
186 } 193 }
187 194
188 // Everything below this is copypasta from ArgvInput private methods 195 // Everything below this is copypasta from ArgvInput private methods
196 // @codeCoverageIgnoreStart
189 197
190 /** 198 /**
191 * Parses a short option. 199 * Parses a short option.
192 * 200 *
193 * @param string $token The current token 201 * @param string $token The current token
321 $this->options[$name][] = $value; 329 $this->options[$name][] = $value;
322 } else { 330 } else {
323 $this->options[$name] = $value; 331 $this->options[$name] = $value;
324 } 332 }
325 } 333 }
334
335 // @codeCoverageIgnoreEnd
326 } 336 }