private function YamlFileLoader::resolveServices in Service Container 7.2
Same name in this branch
- 7.2 lib/Drupal/Core/DependencyInjection/YamlFileLoader.php \Drupal\Core\DependencyInjection\YamlFileLoader::resolveServices()
- 7.2 modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php \Symfony\Component\DependencyInjection\Loader\YamlFileLoader::resolveServices()
Same name and namespace in other branches
- 7 modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php \Symfony\Component\DependencyInjection\Loader\YamlFileLoader::resolveServices()
Resolves services.
Parameters
string|array $value:
Return value
array|string|Reference
2 calls to YamlFileLoader::resolveServices()
- YamlFileLoader::load in modules/
providers/ service_container_symfony/ lib/ Symfony/ Component/ DependencyInjection/ Loader/ YamlFileLoader.php - YamlFileLoader::parseDefinition in modules/
providers/ service_container_symfony/ lib/ Symfony/ Component/ DependencyInjection/ Loader/ YamlFileLoader.php - Parses a definition.
File
- modules/
providers/ service_container_symfony/ lib/ Symfony/ Component/ DependencyInjection/ Loader/ YamlFileLoader.php, line 369
Class
- YamlFileLoader
- YamlFileLoader loads YAML files service definitions.
Namespace
Symfony\Component\DependencyInjection\LoaderCode
private function resolveServices($value) {
if (is_array($value)) {
$value = array_map(array(
$this,
'resolveServices',
), $value);
}
elseif (is_string($value) && 0 === strpos($value, '@=')) {
return new Expression(substr($value, 2));
}
elseif (is_string($value) && 0 === strpos($value, '@')) {
if (0 === strpos($value, '@@')) {
$value = substr($value, 1);
$invalidBehavior = null;
}
elseif (0 === strpos($value, '@?')) {
$value = substr($value, 2);
$invalidBehavior = ContainerInterface::IGNORE_ON_INVALID_REFERENCE;
}
else {
$value = substr($value, 1);
$invalidBehavior = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE;
}
if ('=' === substr($value, -1)) {
$value = substr($value, 0, -1);
$strict = false;
}
else {
$strict = true;
}
if (null !== $invalidBehavior) {
$value = new Reference($value, $invalidBehavior, $strict);
}
}
return $value;
}