comparison vendor/symfony/dependency-injection/Compiler/PassConfig.php @ 14:1fec387a4317

Update Drupal core to 8.5.2 via Composer
author Chris Cannam
date Mon, 23 Apr 2018 09:46:53 +0100
parents 4c8ae668cc8c
children 129ea1e6d783
comparison
equal deleted inserted replaced
13:5fb285c0d0e3 14:1fec387a4317
37 37
38 public function __construct() 38 public function __construct()
39 { 39 {
40 $this->mergePass = new MergeExtensionConfigurationPass(); 40 $this->mergePass = new MergeExtensionConfigurationPass();
41 41
42 $this->beforeOptimizationPasses = array(
43 100 => array(
44 $resolveClassPass = new ResolveClassPass(),
45 new ResolveInstanceofConditionalsPass(),
46 new RegisterEnvVarProcessorsPass(),
47 ),
48 -1000 => array(new ExtensionCompilerPass()),
49 );
50
42 $this->optimizationPasses = array(array( 51 $this->optimizationPasses = array(array(
43 new ExtensionCompilerPass(), 52 new ResolveChildDefinitionsPass(),
44 new ResolveDefinitionTemplatesPass(), 53 new ServiceLocatorTagPass(),
45 new DecoratorServicePass(), 54 new DecoratorServicePass(),
46 new ResolveParameterPlaceHoldersPass(), 55 new ResolveParameterPlaceHoldersPass(false),
47 new FactoryReturnTypePass(), 56 new ResolveFactoryClassPass(),
57 new FactoryReturnTypePass($resolveClassPass),
48 new CheckDefinitionValidityPass(), 58 new CheckDefinitionValidityPass(),
59 new RegisterServiceSubscribersPass(),
60 new ResolveNamedArgumentsPass(),
61 new AutowireRequiredMethodsPass(),
62 new ResolveBindingsPass(),
63 new AutowirePass(false),
64 new ResolveTaggedIteratorArgumentPass(),
65 new ResolveServiceSubscribersPass(),
49 new ResolveReferencesToAliasesPass(), 66 new ResolveReferencesToAliasesPass(),
50 new ResolveInvalidReferencesPass(), 67 new ResolveInvalidReferencesPass(),
51 new AutowirePass(),
52 new AnalyzeServiceReferencesPass(true), 68 new AnalyzeServiceReferencesPass(true),
53 new CheckCircularReferencesPass(), 69 new CheckCircularReferencesPass(),
54 new CheckReferenceValidityPass(), 70 new CheckReferenceValidityPass(),
71 new CheckArgumentsValidityPass(false),
55 )); 72 ));
73
74 $this->beforeRemovingPasses = array(
75 -100 => array(
76 new ResolvePrivatesPass(),
77 ),
78 );
56 79
57 $this->removingPasses = array(array( 80 $this->removingPasses = array(array(
58 new RemovePrivateAliasesPass(), 81 new RemovePrivateAliasesPass(),
59 new ReplaceAliasByActualDefinitionPass(), 82 new ReplaceAliasByActualDefinitionPass(),
60 new RemoveAbstractDefinitionsPass(), 83 new RemoveAbstractDefinitionsPass(),
62 new AnalyzeServiceReferencesPass(), 85 new AnalyzeServiceReferencesPass(),
63 new InlineServiceDefinitionsPass(), 86 new InlineServiceDefinitionsPass(),
64 new AnalyzeServiceReferencesPass(), 87 new AnalyzeServiceReferencesPass(),
65 new RemoveUnusedDefinitionsPass(), 88 new RemoveUnusedDefinitionsPass(),
66 )), 89 )),
90 new DefinitionErrorExceptionPass(),
67 new CheckExceptionOnInvalidReferenceBehaviorPass(), 91 new CheckExceptionOnInvalidReferenceBehaviorPass(),
92 new ResolveHotPathPass(),
68 )); 93 ));
69 } 94 }
70 95
71 /** 96 /**
72 * Returns all passes in order to be processed. 97 * Returns all passes in order to be processed.
92 * @param string $type The pass type 117 * @param string $type The pass type
93 * @param int $priority Used to sort the passes 118 * @param int $priority Used to sort the passes
94 * 119 *
95 * @throws InvalidArgumentException when a pass type doesn't exist 120 * @throws InvalidArgumentException when a pass type doesn't exist
96 */ 121 */
97 public function addPass(CompilerPassInterface $pass, $type = self::TYPE_BEFORE_OPTIMIZATION/*, $priority = 0*/) 122 public function addPass(CompilerPassInterface $pass, $type = self::TYPE_BEFORE_OPTIMIZATION/*, int $priority = 0*/)
98 { 123 {
99 if (func_num_args() >= 3) { 124 if (func_num_args() >= 3) {
100 $priority = func_get_arg(2); 125 $priority = func_get_arg(2);
101 } else { 126 } else {
102 if (__CLASS__ !== get_class($this)) { 127 if (__CLASS__ !== get_class($this)) {
103 $r = new \ReflectionMethod($this, __FUNCTION__); 128 $r = new \ReflectionMethod($this, __FUNCTION__);
104 if (__CLASS__ !== $r->getDeclaringClass()->getName()) { 129 if (__CLASS__ !== $r->getDeclaringClass()->getName()) {
105 @trigger_error(sprintf('Method %s() will have a third `$priority = 0` argument in version 4.0. Not defining it is deprecated since 3.2.', __METHOD__), E_USER_DEPRECATED); 130 @trigger_error(sprintf('Method %s() will have a third `int $priority = 0` argument in version 4.0. Not defining it is deprecated since Symfony 3.2.', __METHOD__), E_USER_DEPRECATED);
106 } 131 }
107 } 132 }
108 133
109 $priority = 0; 134 $priority = 0;
110 } 135 }
180 public function getMergePass() 205 public function getMergePass()
181 { 206 {
182 return $this->mergePass; 207 return $this->mergePass;
183 } 208 }
184 209
185 /**
186 * Sets the Merge Pass.
187 *
188 * @param CompilerPassInterface $pass The merge pass
189 */
190 public function setMergePass(CompilerPassInterface $pass) 210 public function setMergePass(CompilerPassInterface $pass)
191 { 211 {
192 $this->mergePass = $pass; 212 $this->mergePass = $pass;
193 } 213 }
194 214