if('txt' === $options['format'] && isset($options['id'])){ if($object->hasDefinition($options['id'])){ $definition = $object->getDefinition($options['id']); if($definition->isDeprecated()){ $errorIo->warning($definition->getDeprecation($options['id'])['message'] ?? sprintf('The "%s" service is deprecated.', $options['id'])); } } if($object->hasAlias($options['id'])){ $alias = $object->getAlias($options['id']); if($alias->isDeprecated()){ $errorIo->warning($alias->getDeprecation($options['id'])['message'] ?? sprintf('The "%s" alias is deprecated.', $options['id'])); } } }
if(isset($options['id']) && isset($kernel->getContainer()->getRemovedIds()[$options['id']])){ $errorIo->note(sprintf('The "%s" service or alias has been removed or inlined when the container was compiled.', $options['id'])); } }catch(ServiceNotFoundException $e){
if($public){ $this->assertFalse($container->hasAlias($alias)); }else{ // The alias is replaced by a Definition by the ReplaceAliasByActualDefinitionPass
// in case the original service is private
$this->assertFalse($container->hasDefinition($id)); $this->assertTrue($container->hasDefinition($alias)); }
$this->assertTrue($container->hasDefinition('ssi'), '->registerSsiConfiguration() loads ssi.xml'); $this->assertTrue($container->hasDefinition('fragment.renderer.ssi'), 'The SSI fragment renderer is registered'); }
$this->assertSame('.container.private.foo', (string)$alias); $this->assertTrue($alias->isPublic()); $this->assertFalse($alias->isPrivate()); $this->assertSame([ 'package' => 'foo/bar', 'version' => '1.2', 'message' => 'Accessing the "foo" service directly from the container is deprecated, use dependency injection instead.', ], $alias->getDeprecation('foo')); }
$controllerDef = $container->getDefinition($id); foreach($controllerDef->getMethodCalls()as[$method]){ if(0 === strcasecmp($action, $method)){ $reason = sprintf('Removing method "%s" of service "%s" from controller candidates: the method is called at instantiation, thus cannot be an action.', $action, $id); break; } } if(!$reason){
publicfunctionprocess(ContainerBuilder $container) { foreach($container->findTaggedServiceIds('auto_alias')as$serviceId => $tags){ foreach($tagsas$tag){ if(!isset($tag['format'])){ thrownewInvalidArgumentException(sprintf('Missing tag information "format" on auto_alias service "%s".', $serviceId)); }