@@ -339,7 +339,7 @@ public function configure(array $config)
339
339
{
340
340
// This is a bulk update/initial configuration
341
341
// So we check all definitions
342
- $ this ->validateConfig ($ config );
342
+ $ this ->validateServiceNameConfig ($ config );
343
343
344
344
if (isset ($ config ['services ' ])) {
345
345
$ this ->services = $ config ['services ' ] + $ this ->services ;
@@ -422,7 +422,7 @@ public function configure(array $config)
422
422
*/
423
423
public function setAlias ($ alias , $ target )
424
424
{
425
- $ this ->validate ($ alias );
425
+ $ this ->validateServiceName ($ alias );
426
426
$ this ->doSetAlias ($ alias , $ target );
427
427
}
428
428
@@ -447,7 +447,7 @@ public function setInvokableClass($name, $class = null)
447
447
*/
448
448
public function setFactory ($ name , $ factory )
449
449
{
450
- $ this ->validate ($ name );
450
+ $ this ->validateServiceName ($ name );
451
451
$ this ->factories [$ name ] = $ factory ;
452
452
}
453
453
@@ -503,7 +503,7 @@ public function addInitializer($initializer)
503
503
*/
504
504
public function setService ($ name , $ service )
505
505
{
506
- $ this ->validate ($ name );
506
+ $ this ->validateServiceName ($ name );
507
507
$ this ->services [$ name ] = $ service ;
508
508
}
509
509
@@ -515,7 +515,7 @@ public function setService($name, $service)
515
515
*/
516
516
public function setShared ($ name , $ flag )
517
517
{
518
- $ this ->validate ($ name );
518
+ $ this ->validateServiceName ($ name );
519
519
$ this ->shared [$ name ] = (bool ) $ flag ;
520
520
}
521
521
@@ -813,10 +813,10 @@ private function createFactoriesForInvokables(array $invokables)
813
813
* @throws ContainerModificationsNotAllowedException if the
814
814
* provided service name is invalid.
815
815
*/
816
- private function validate ($ service )
816
+ private function validateServiceName ($ service )
817
817
{
818
818
// Important: Next three lines must kept equal to the three
819
- // lines of validateArray (see below) which are marked as code
819
+ // lines of validateServiceNameArray (see below) which are marked as code
820
820
// duplicate!
821
821
if (! isset ($ this ->services [$ service ]) ?: $ this ->allowOverride ) {
822
822
return ;
@@ -843,18 +843,18 @@ private function validate($service)
843
843
* @throws ContainerModificationsNotAllowedException if any
844
844
* array keys is invalid.
845
845
*/
846
- private function validateArray (array $ services )
846
+ private function validateServiceNameArray (array $ services )
847
847
{
848
848
$ keys = \array_keys ($ services );
849
849
foreach ($ keys as $ service ) {
850
- // This is a code duplication from validate (see above).
851
- // validate is almost a one liner, so we reproduce it
850
+ // This is a code duplication from validateServiceName (see above).
851
+ // validateServiceName is almost a one liner, so we reproduce it
852
852
// here for the sake of performance of aggregated service
853
853
// manager configurations (we save the overhead the function
854
854
// call would produce)
855
855
//
856
856
// Important: Next three lines MUST kept equal to the first
857
- // three lines of validate !
857
+ // three lines of validateServiceName !
858
858
if (! isset ($ this ->services [$ service ]) ?: $ this ->allowOverride ) {
859
859
return ;
860
860
}
@@ -881,7 +881,7 @@ private function validateArray(array $services)
881
881
* @throws ContainerModificationsNotAllowedException if any
882
882
* service key is invalid.
883
883
*/
884
- private function validateConfig (array $ config )
884
+ private function validateServiceNameConfig (array $ config )
885
885
{
886
886
if ($ this ->allowOverride || ! $ this ->configured ) {
887
887
return ;
@@ -891,12 +891,12 @@ private function validateConfig(array $config)
891
891
892
892
foreach ($ sections as $ section ) {
893
893
if (isset ($ config [$ section ])) {
894
- $ this ->validateArray ($ config [$ section ]);
894
+ $ this ->validateServiceNameArray ($ config [$ section ]);
895
895
}
896
896
}
897
897
898
898
if (isset ($ config ['lazy_services ' ]['class_map ' ])) {
899
- $ this ->validateArray ($ config ['lazy_services ' ]['class_map ' ]);
899
+ $ this ->validateServiceNameArray ($ config ['lazy_services ' ]['class_map ' ]);
900
900
}
901
901
}
902
902
0 commit comments