/usr/share/php/Symfony/Component/DependencyInjection/Compiler
NameSizeModeActions
AbstractRecursivePass.php93310644editdlrm
AliasDeprecatedPublicServicesPass.php25590644editdlrm
AnalyzeServiceReferencesPass.php63260644editdlrm
AttributeAutoconfigurationPass.php76220644editdlrm
AutoAliasServicePass.php19080644editdlrm
AutowirePass.php252190644editdlrm
AutowireRequiredMethodsPass.php38670644editdlrm
AutowireRequiredPropertiesPass.php22860644editdlrm
CheckArgumentsValidityPass.php43860644editdlrm
CheckCircularReferencesPass.php24480644editdlrm
CheckDefinitionValidityPass.php47410644editdlrm
CheckExceptionOnInvalidReferenceBehaviorPass.php36630644editdlrm
CheckReferenceValidityPass.php14770644editdlrm
CheckTypeDeclarationsPass.php123690644editdlrm
Compiler.php27240644editdlrm
CompilerPassInterface.php6680644editdlrm
DecoratorServicePass.php52570644editdlrm
DefinitionErrorExceptionPass.php18700644editdlrm
ExtensionCompilerPass.php8920644editdlrm
InlineServiceDefinitionsPass.php75850644editdlrm
MergeExtensionConfigurationPass.php85630644editdlrm
PassConfig.php75470644editdlrm
PriorityTaggedServiceTrait.php68110644editdlrm
RegisterAutoconfigureAttributesPass.php33530644editdlrm
RegisterEnvVarProcessorsPass.php30040644editdlrm
RegisterReverseContainerPass.php24220644editdlrm
RegisterServiceSubscribersPass.php66510644editdlrm
RemoveAbstractDefinitionsPass.php9080644editdlrm
RemovePrivateAliasesPass.php11140644editdlrm
RemoveUnusedDefinitionsPass.php28600644editdlrm
ReplaceAliasByActualDefinitionPass.php44910644editdlrm
ResolveBindingsPass.php92330644editdlrm
ResolveChildDefinitionsPass.php75380644editdlrm
ResolveClassPass.php15610644editdlrm
ResolveDecoratorStackPass.php46100644editdlrm
ResolveEnvPlaceholdersPass.php13570644editdlrm
ResolveFactoryClassPass.php12170644editdlrm
ResolveHotPathPass.php25530644editdlrm
ResolveInstanceofConditionalsPass.php71710644editdlrm
ResolveInvalidReferencesPass.php53320644editdlrm
ResolveNamedArgumentsPass.php55810644editdlrm
ResolveNoPreloadPass.php33640644editdlrm
ResolveParameterPlaceHoldersPass.php29690644editdlrm
ResolvePrivatesPass.php11780644editdlrm
ResolveReferencesToAliasesPass.php27580644editdlrm
ResolveServiceSubscribersPass.php16370644editdlrm
ResolveTaggedIteratorArgumentPass.php9520644editdlrm
ServiceLocatorTagPass.php52730644editdlrm
ServiceReferenceGraph.php26440644editdlrm
ServiceReferenceGraphEdge.php21840644editdlrm
ServiceReferenceGraphNode.php22990644editdlrm
ValidateEnvPlaceholdersPass.php38840644editdlrm
Edit: /usr/share/php/Symfony/Component/DependencyInjection/Compiler/CheckDefinitionValidityPass.php (4741B)
* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\DependencyInjection\Compiler; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Exception\EnvParameterException; use Symfony\Component\DependencyInjection\Exception\RuntimeException; use Symfony\Component\DependencyInjection\Loader\FileLoader; /** * This pass validates each definition individually only taking the information * into account which is contained in the definition itself. * * Later passes can rely on the following, and specifically do not need to * perform these checks themselves: * * - non synthetic, non abstract services always have a class set * - synthetic services are always public * * @author Johannes M. Schmitt */ class CheckDefinitionValidityPass implements CompilerPassInterface { /** * Processes the ContainerBuilder to validate the Definition. * * @throws RuntimeException When the Definition is invalid */ public function process(ContainerBuilder $container) { foreach ($container->getDefinitions() as $id => $definition) { // synthetic service is public if ($definition->isSynthetic() && !$definition->isPublic()) { throw new RuntimeException(sprintf('A synthetic service ("%s") must be public.', $id)); } // non-synthetic, non-abstract service has class if (!$definition->isAbstract() && !$definition->isSynthetic() && !$definition->getClass() && !$definition->hasTag('container.service_locator') && (!$definition->getFactory() || !preg_match(FileLoader::ANONYMOUS_ID_REGEXP, $id))) { if ($definition->getFactory()) { throw new RuntimeException(sprintf('Please add the class to service "%s" even if it is constructed by a factory since we might need to add method calls based on compile-time checks.', $id)); } if (class_exists($id) || interface_exists($id, false)) { if (str_starts_with($id, '\\') && 1 < substr_count($id, '\\')) { throw new RuntimeException(sprintf('The definition for "%s" has no class attribute, and appears to reference a class or interface. Please specify the class attribute explicitly or remove the leading backslash by renaming the service to "%s" to get rid of this error.', $id, substr($id, 1))); } throw new RuntimeException(sprintf('The definition for "%s" has no class attribute, and appears to reference a class or interface in the global namespace. Leaving out the "class" attribute is only allowed for namespaced classes. Please specify the class attribute explicitly to get rid of this error.', $id)); } throw new RuntimeException(sprintf('The definition for "%s" has no class. If you intend to inject this service dynamically at runtime, please mark it as synthetic=true. If this is an abstract definition solely used by child definitions, please add abstract=true, otherwise specify a class to get rid of this error.', $id)); } // tag attribute values must be scalars foreach ($definition->getTags() as $name => $tags) { foreach ($tags as $attributes) { foreach ($attributes as $attribute => $value) { if (!is_scalar($value) && null !== $value) { throw new RuntimeException(sprintf('A "tags" attribute must be of a scalar-type for service "%s", tag "%s", attribute "%s".', $id, $name, $attribute)); } } } } if ($definition->isPublic() && !$definition->isPrivate()) { $resolvedId = $container->resolveEnvPlaceholders($id, null, $usedEnvs); if (null !== $usedEnvs) { throw new EnvParameterException([$resolvedId], null, 'A service name ("%s") cannot contain dynamic values.'); } } } foreach ($container->getAliases() as $id => $alias) { if ($alias->isPublic() && !$alias->isPrivate()) { $resolvedId = $container->resolveEnvPlaceholders($id, null, $usedEnvs); if (null !== $usedEnvs) { throw new EnvParameterException([$resolvedId], null, 'An alias name ("%s") cannot contain dynamic values.'); } } } } }