Skip to content

Commit

Permalink
[Console] Fix trying to access array offset on value of type int
Browse files Browse the repository at this point in the history
  • Loading branch information
eskylake authored and nicolas-grekas committed Nov 28, 2019
1 parent 5cacc5d commit 069d214
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Symfony/Component/Console/Input/ArrayInput.php
Expand Up @@ -39,8 +39,8 @@ public function __construct(array $parameters, InputDefinition $definition = nul
*/
public function getFirstArgument()
{
foreach ($this->parameters as $key => $value) {
if ($key && '-' === $key[0]) {
foreach ($this->parameters as $param => $value) {
if ($param && \is_string($param) && '-' === $param[0]) {
continue;
}

Expand Down Expand Up @@ -107,7 +107,7 @@ public function __toString()
{
$params = [];
foreach ($this->parameters as $param => $val) {
if ($param && '-' === $param[0]) {
if ($param && \is_string($param) && '-' === $param[0]) {
if (\is_array($val)) {
foreach ($val as $v) {
$params[] = $param.('' != $v ? '='.$this->escapeToken($v) : '');
Expand Down

0 comments on commit 069d214

Please sign in to comment.