comparison vendor/symfony/dependency-injection/Compiler/ResolveBindingsPass.php @ 5:12f9dff5fda9 tip

Update to Drupal core 8.7.1
author Chris Cannam
date Thu, 09 May 2019 15:34:47 +0100
parents a9cd425dd02b
children
comparison
equal deleted inserted replaced
4:a9cd425dd02b 5:12f9dff5fda9
32 /** 32 /**
33 * {@inheritdoc} 33 * {@inheritdoc}
34 */ 34 */
35 public function process(ContainerBuilder $container) 35 public function process(ContainerBuilder $container)
36 { 36 {
37 $this->usedBindings = $container->getRemovedBindingIds();
38
37 try { 39 try {
38 parent::process($container); 40 parent::process($container);
39 41
40 foreach ($this->unusedBindings as list($key, $serviceId)) { 42 foreach ($this->unusedBindings as list($key, $serviceId)) {
41 $message = sprintf('Unused binding "%s" in service "%s".', $key, $serviceId); 43 $message = sprintf('Unused binding "%s" in service "%s".', $key, $serviceId);
113 list($method, $arguments) = $call; 115 list($method, $arguments) = $call;
114 116
115 if ($method instanceof \ReflectionFunctionAbstract) { 117 if ($method instanceof \ReflectionFunctionAbstract) {
116 $reflectionMethod = $method; 118 $reflectionMethod = $method;
117 } else { 119 } else {
118 $reflectionMethod = $this->getReflectionMethod($value, $method); 120 try {
121 $reflectionMethod = $this->getReflectionMethod($value, $method);
122 } catch (RuntimeException $e) {
123 if ($value->getFactory()) {
124 continue;
125 }
126 throw $e;
127 }
119 } 128 }
120 129
121 foreach ($reflectionMethod->getParameters() as $key => $parameter) { 130 foreach ($reflectionMethod->getParameters() as $key => $parameter) {
122 if (array_key_exists($key, $arguments) && '' !== $arguments[$key]) { 131 if (\array_key_exists($key, $arguments) && '' !== $arguments[$key]) {
123 continue; 132 continue;
124 } 133 }
125 134
126 if (array_key_exists('$'.$parameter->name, $bindings)) { 135 if (\array_key_exists('$'.$parameter->name, $bindings)) {
127 $arguments[$key] = $this->getBindingValue($bindings['$'.$parameter->name]); 136 $arguments[$key] = $this->getBindingValue($bindings['$'.$parameter->name]);
128 137
129 continue; 138 continue;
130 } 139 }
131 140