Skip to content

Commit 9c88caa

Browse files
committed
Container*::getServiceIds() should return an array of string
see symfony#32549
1 parent 9e4d5ff commit 9c88caa

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/Symfony/Component/DependencyInjection/Container.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ public function reset()
386386
/**
387387
* Gets all service ids.
388388
*
389-
* @return array An array of all defined service ids
389+
* @return string[] An array of all defined service ids
390390
*/
391391
public function getServiceIds()
392392
{
@@ -405,7 +405,7 @@ public function getServiceIds()
405405
}
406406
$ids[] = 'service_container';
407407

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

411411
/**

src/Symfony/Component/DependencyInjection/ContainerBuilder.php

+2-4
Original file line numberDiff line numberDiff line change
@@ -815,13 +815,11 @@ public function compile(/*$resolveEnvPlaceholders = false*/)
815815
}
816816

817817
/**
818-
* Gets all service ids.
819-
*
820-
* @return array An array of all defined service ids
818+
* {@inheritdoc}
821819
*/
822820
public function getServiceIds()
823821
{
824-
return array_unique(array_merge(array_keys($this->getDefinitions()), array_keys($this->aliasDefinitions), parent::getServiceIds()));
822+
return array_map('strval', array_unique(array_merge(array_keys($this->getDefinitions()), array_keys($this->aliasDefinitions), parent::getServiceIds())));
825823
}
826824

827825
/**

0 commit comments

Comments
 (0)