Skip to content

Commit

Permalink
Container*::getServiceIds() should return an array of string
Browse files Browse the repository at this point in the history
see #32549
  • Loading branch information
mathroc committed Jul 16, 2019
1 parent e106c74 commit 2e11d89
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 2 additions & 2 deletions Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ public function reset()
/**
* Gets all service ids.
*
* @return array An array of all defined service ids
* @return string[] An array of all defined service ids
*/
public function getServiceIds()
{
Expand All @@ -405,7 +405,7 @@ public function getServiceIds()
}
$ids[] = 'service_container';

return array_unique(array_merge($ids, array_keys($this->methodMap), array_keys($this->fileMap), array_keys($this->services)));
return array_map('strval', array_unique(array_merge($ids, array_keys($this->methodMap), array_keys($this->fileMap), array_keys($this->services))));
}

/**
Expand Down
6 changes: 2 additions & 4 deletions ContainerBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -815,13 +815,11 @@ public function compile(/*$resolveEnvPlaceholders = false*/)
}

/**
* Gets all service ids.
*
* @return array An array of all defined service ids
* {@inheritdoc}
*/
public function getServiceIds()
{
return array_unique(array_merge(array_keys($this->getDefinitions()), array_keys($this->aliasDefinitions), parent::getServiceIds()));
return array_map('strval', array_unique(array_merge(array_keys($this->getDefinitions()), array_keys($this->aliasDefinitions), parent::getServiceIds())));
}

/**
Expand Down

0 comments on commit 2e11d89

Please sign in to comment.