Submit
Path:
~
/
/
proc
/
self
/
root
/
opt
/
psa
/
admin
/
plib
/
modules
/
wp-toolkit
/
vendor
/
symfony
/
dependency-injection
/
Compiler
/
File Content:
PassConfig.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 WPToolkitDependenciesIsolationPrefix\Symfony\Component\DependencyInjection\Compiler; use WPToolkitDependenciesIsolationPrefix\Symfony\Component\DependencyInjection\Exception\InvalidArgumentException; /** * Compiler Pass Configuration. * * This class has a default configuration embedded. * * @author Johannes M. Schmitt <schmittjoh@gmail.com> */ class PassConfig { public const TYPE_AFTER_REMOVING = 'afterRemoving'; public const TYPE_BEFORE_OPTIMIZATION = 'beforeOptimization'; public const TYPE_BEFORE_REMOVING = 'beforeRemoving'; public const TYPE_OPTIMIZE = 'optimization'; public const TYPE_REMOVE = 'removing'; private MergeExtensionConfigurationPass $mergePass; private array $afterRemovingPasses; private array $beforeOptimizationPasses; private array $beforeRemovingPasses = []; private array $optimizationPasses; private array $removingPasses; public function __construct() { $this->mergePass = new MergeExtensionConfigurationPass(); $this->beforeOptimizationPasses = [100 => [new ResolveClassPass(), new RegisterAutoconfigureAttributesPass(), new AutowireAsDecoratorPass(), new AttributeAutoconfigurationPass(), new ResolveInstanceofConditionalsPass(), new RegisterEnvVarProcessorsPass()], -1000 => [new ExtensionCompilerPass()]]; $this->optimizationPasses = [[new AutoAliasServicePass(), new ValidateEnvPlaceholdersPass(), new ResolveDecoratorStackPass(), new ResolveChildDefinitionsPass(), new RegisterServiceSubscribersPass(), new ResolveParameterPlaceHoldersPass(\false, \false), new ResolveFactoryClassPass(), new ResolveNamedArgumentsPass(), new AutowireRequiredMethodsPass(), new AutowireRequiredPropertiesPass(), new ResolveBindingsPass(), new ServiceLocatorTagPass(), new DecoratorServicePass(), new CheckDefinitionValidityPass(), new AutowirePass(\false), new ServiceLocatorTagPass(), new ResolveTaggedIteratorArgumentPass(), new ResolveServiceSubscribersPass(), new ResolveReferencesToAliasesPass(), new ResolveInvalidReferencesPass(), new AnalyzeServiceReferencesPass(\true), new CheckCircularReferencesPass(), new CheckReferenceValidityPass(), new CheckArgumentsValidityPass(\false)]]; $this->removingPasses = [[new RemovePrivateAliasesPass(), new ReplaceAliasByActualDefinitionPass(), new RemoveAbstractDefinitionsPass(), new RemoveUnusedDefinitionsPass(), new AnalyzeServiceReferencesPass(), new CheckExceptionOnInvalidReferenceBehaviorPass(), new InlineServiceDefinitionsPass(new AnalyzeServiceReferencesPass()), new AnalyzeServiceReferencesPass(), new DefinitionErrorExceptionPass()]]; $this->afterRemovingPasses = [ 0 => [new ResolveHotPathPass(), new ResolveNoPreloadPass(), new AliasDeprecatedPublicServicesPass()], // Let build parameters be available as late as possible -2048 => [new RemoveBuildParametersPass()], ]; } /** * Returns all passes in order to be processed. * * @return CompilerPassInterface[] */ public function getPasses() : array { return \array_merge([$this->mergePass], $this->getBeforeOptimizationPasses(), $this->getOptimizationPasses(), $this->getBeforeRemovingPasses(), $this->getRemovingPasses(), $this->getAfterRemovingPasses()); } /** * Adds a pass. * * @throws InvalidArgumentException when a pass type doesn't exist */ public function addPass(CompilerPassInterface $pass, string $type = self::TYPE_BEFORE_OPTIMIZATION, int $priority = 0) : void { $property = $type . 'Passes'; if (!isset($this->{$property})) { throw new InvalidArgumentException(\sprintf('Invalid type "%s".', $type)); } $passes =& $this->{$property}; if (!isset($passes[$priority])) { $passes[$priority] = []; } $passes[$priority][] = $pass; } /** * Gets all passes for the AfterRemoving pass. * * @return CompilerPassInterface[] */ public function getAfterRemovingPasses() : array { return $this->sortPasses($this->afterRemovingPasses); } /** * Gets all passes for the BeforeOptimization pass. * * @return CompilerPassInterface[] */ public function getBeforeOptimizationPasses() : array { return $this->sortPasses($this->beforeOptimizationPasses); } /** * Gets all passes for the BeforeRemoving pass. * * @return CompilerPassInterface[] */ public function getBeforeRemovingPasses() : array { return $this->sortPasses($this->beforeRemovingPasses); } /** * Gets all passes for the Optimization pass. * * @return CompilerPassInterface[] */ public function getOptimizationPasses() : array { return $this->sortPasses($this->optimizationPasses); } /** * Gets all passes for the Removing pass. * * @return CompilerPassInterface[] */ public function getRemovingPasses() : array { return $this->sortPasses($this->removingPasses); } /** * Gets the Merge pass. */ public function getMergePass() : CompilerPassInterface { return $this->mergePass; } public function setMergePass(CompilerPassInterface $pass) : void { $this->mergePass = $pass; } /** * Sets the AfterRemoving passes. * * @param CompilerPassInterface[] $passes */ public function setAfterRemovingPasses(array $passes) : void { $this->afterRemovingPasses = [$passes]; } /** * Sets the BeforeOptimization passes. * * @param CompilerPassInterface[] $passes */ public function setBeforeOptimizationPasses(array $passes) : void { $this->beforeOptimizationPasses = [$passes]; } /** * Sets the BeforeRemoving passes. * * @param CompilerPassInterface[] $passes */ public function setBeforeRemovingPasses(array $passes) : void { $this->beforeRemovingPasses = [$passes]; } /** * Sets the Optimization passes. * * @param CompilerPassInterface[] $passes */ public function setOptimizationPasses(array $passes) : void { $this->optimizationPasses = [$passes]; } /** * Sets the Removing passes. * * @param CompilerPassInterface[] $passes */ public function setRemovingPasses(array $passes) : void { $this->removingPasses = [$passes]; } /** * Sort passes by priority. * * @param array $passes CompilerPassInterface instances with their priority as key * * @return CompilerPassInterface[] */ private function sortPasses(array $passes) : array { if (0 === \count($passes)) { return []; } \krsort($passes); // Flatten the array return \array_merge(...$passes); } }
Submit
FILE
FOLDER
INFO
Name
Size
Permission
Action
AbstractRecursivePass.php
10755 bytes
0644
AliasDeprecatedPublicServicesPass.php
2344 bytes
0644
AnalyzeServiceReferencesPass.php
6979 bytes
0644
AttributeAutoconfigurationPass.php
7786 bytes
0644
AutoAliasServicePass.php
1572 bytes
0644
AutowireAsDecoratorPass.php
1782 bytes
0644
AutowirePass.php
31502 bytes
0644
AutowireRequiredMethodsPass.php
3231 bytes
0644
AutowireRequiredPropertiesPass.php
2183 bytes
0644
CheckArgumentsValidityPass.php
4469 bytes
0644
CheckCircularReferencesPass.php
2577 bytes
0644
CheckDefinitionValidityPass.php
5243 bytes
0644
CheckExceptionOnInvalidReferenceBehaviorPass.php
4903 bytes
0644
CheckReferenceValidityPass.php
1678 bytes
0644
CheckTypeDeclarationsPass.php
13072 bytes
0644
Compiler.php
2752 bytes
0644
CompilerPassInterface.php
767 bytes
0644
DecoratorServicePass.php
5676 bytes
0644
DefinitionErrorExceptionPass.php
3519 bytes
0644
ExtensionCompilerPass.php
933 bytes
0644
InlineServiceDefinitionsPass.php
8183 bytes
0644
MergeExtensionConfigurationPass.php
8836 bytes
0644
PassConfig.php
7172 bytes
0644
PriorityTaggedServiceTrait.php
7092 bytes
0644
RegisterAutoconfigureAttributesPass.php
3196 bytes
0644
RegisterEnvVarProcessorsPass.php
3261 bytes
0644
RegisterReverseContainerPass.php
2301 bytes
0644
RegisterServiceSubscribersPass.php
7273 bytes
0644
RemoveAbstractDefinitionsPass.php
988 bytes
0644
RemoveBuildParametersPass.php
1240 bytes
0644
RemovePrivateAliasesPass.php
1193 bytes
0644
RemoveUnusedDefinitionsPass.php
2997 bytes
0644
ReplaceAliasByActualDefinitionPass.php
4027 bytes
0644
ResolveBindingsPass.php
10761 bytes
0644
ResolveChildDefinitionsPass.php
7872 bytes
0644
ResolveClassPass.php
1688 bytes
0644
ResolveDecoratorStackPass.php
4656 bytes
0644
ResolveEnvPlaceholdersPass.php
1489 bytes
0644
ResolveFactoryClassPass.php
1346 bytes
0644
ResolveHotPathPass.php
2445 bytes
0644
ResolveInstanceofConditionalsPass.php
7327 bytes
0644
ResolveInvalidReferencesPass.php
5818 bytes
0644
ResolveNamedArgumentsPass.php
6315 bytes
0644
ResolveNoPreloadPass.php
3206 bytes
0644
ResolveParameterPlaceHoldersPass.php
3335 bytes
0644
ResolveReferencesToAliasesPass.php
2893 bytes
0644
ResolveServiceSubscribersPass.php
1850 bytes
0644
ResolveTaggedIteratorArgumentPass.php
1181 bytes
0644
ServiceLocatorTagPass.php
5118 bytes
0644
ServiceReferenceGraph.php
2790 bytes
0644
ServiceReferenceGraphEdge.php
2175 bytes
0644
ServiceReferenceGraphNode.php
2279 bytes
0644
ValidateEnvPlaceholdersPass.php
3918 bytes
0644
N4ST4R_ID | Naxtarrr