Submit
Path:
~
/
/
opt
/
cloudlinux
/
alt-php54
/
root
/
usr
/
share
/
pear
/
Symfony
/
Component
/
DependencyInjection
/
Compiler
/
File Content:
ResolveReferencesToAliasesPass.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\Alias; use Symfony\Component\DependencyInjection\Reference; use Symfony\Component\DependencyInjection\ContainerBuilder; /** * Replaces all references to aliases with references to the actual service. * * @author Johannes M. Schmitt <schmittjoh@gmail.com> */ class ResolveReferencesToAliasesPass implements CompilerPassInterface { private $container; /** * Processes the ContainerBuilder to replace references to aliases with actual service references. * * @param ContainerBuilder $container */ public function process(ContainerBuilder $container) { $this->container = $container; foreach ($container->getDefinitions() as $definition) { if ($definition->isSynthetic() || $definition->isAbstract()) { continue; } $definition->setArguments($this->processArguments($definition->getArguments())); $definition->setMethodCalls($this->processArguments($definition->getMethodCalls())); $definition->setProperties($this->processArguments($definition->getProperties())); } foreach ($container->getAliases() as $id => $alias) { $aliasId = (string) $alias; if ($aliasId !== $defId = $this->getDefinitionId($aliasId)) { $container->setAlias($id, new Alias($defId, $alias->isPublic())); } } } /** * Processes the arguments to replace aliases. * * @param array $arguments An array of References * * @return array An array of References */ private function processArguments(array $arguments) { foreach ($arguments as $k => $argument) { if (is_array($argument)) { $arguments[$k] = $this->processArguments($argument); } elseif ($argument instanceof Reference) { $defId = $this->getDefinitionId($id = (string) $argument); if ($defId !== $id) { $arguments[$k] = new Reference($defId, $argument->getInvalidBehavior(), $argument->isStrict()); } } } return $arguments; } /** * Resolves an alias into a definition id. * * @param string $id The definition or alias id to resolve * * @return string The definition id with aliases resolved */ private function getDefinitionId($id) { while ($this->container->hasAlias($id)) { $id = (string) $this->container->getAlias($id); } return $id; } }
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