Submit
Path:
~
/
/
opt
/
cloudlinux
/
alt-php54
/
root
/
usr
/
share
/
pear
/
Symfony
/
Component
/
DependencyInjection
/
Compiler
/
File Content:
CheckDefinitionValidityPass.php
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * 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\ContainerInterface; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Exception\RuntimeException; /** * 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 * - synthetic services are always of non-prototype scope * * @author Johannes M. Schmitt <schmittjoh@gmail.com> */ class CheckDefinitionValidityPass implements CompilerPassInterface { /** * Processes the ContainerBuilder to validate the Definition. * * @param ContainerBuilder $container * * @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 )); } // synthetic service has non-prototype scope if ($definition->isSynthetic() && ContainerInterface::SCOPE_PROTOTYPE === $definition->getScope()) { throw new RuntimeException(sprintf( 'A synthetic service ("%s") cannot be of scope "prototype".', $id )); } // non-synthetic, non-abstract service has class if (!$definition->isAbstract() && !$definition->isSynthetic() && !$definition->getClass()) { if ($definition->getFactoryClass() || $definition->getFactoryService()) { 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 )); } 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)); } } } } } } }
Edit
Rename
Chmod
Delete
FILE
FOLDER
Name
Size
Permission
Action
AnalyzeServiceReferencesPass.php
4512 bytes
0644
CheckCircularReferencesPass.php
2417 bytes
0644
CheckDefinitionValidityPass.php
3684 bytes
0644
CheckExceptionOnInvalidReferenceBehaviorPass.php
2102 bytes
0644
CheckReferenceValidityPass.php
5634 bytes
0644
Compiler.php
2613 bytes
0644
CompilerPassInterface.php
746 bytes
0644
InlineServiceDefinitionsPass.php
4592 bytes
0644
LoggingFormatter.php
1468 bytes
0644
MergeExtensionConfigurationPass.php
1884 bytes
0644
PassConfig.php
6040 bytes
0644
RemoveAbstractDefinitionsPass.php
1063 bytes
0644
RemovePrivateAliasesPass.php
1267 bytes
0644
RemoveUnusedDefinitionsPass.php
2772 bytes
0644
RepeatablePassInterface.php
691 bytes
0644
RepeatedPass.php
2083 bytes
0644
ReplaceAliasByActualDefinitionPass.php
4166 bytes
0644
ResolveDefinitionTemplatesPass.php
5550 bytes
0644
ResolveInvalidReferencesPass.php
3500 bytes
0644
ResolveParameterPlaceHoldersPass.php
2158 bytes
0644
ResolveReferencesToAliasesPass.php
2896 bytes
0644
ServiceReferenceGraph.php
2857 bytes
0644
ServiceReferenceGraphEdge.php
1517 bytes
0644
ServiceReferenceGraphNode.php
2545 bytes
0644
N4ST4R_ID | Naxtarrr