@@ 161-169 (lines=9) @@ | ||
158 | if ($callable instanceof DefinitionInterface) { |
|
159 | return $this->converter->convert($decoratedServiceName, $callable); |
|
160 | } |
|
161 | if (is_array($callable) && is_string($callable[0])) { |
|
162 | return new FactoryCallDefinition($decoratedServiceName, $callable[0], $callable[1], [$containerDefinition]); |
|
163 | } elseif (is_string($callable) && strpos($callable, '::') !== false) { |
|
164 | $pos = strpos($callable, '::'); |
|
165 | $className = substr($callable, 0, $pos); |
|
166 | $methodName = substr($callable, $pos + 2); |
|
167 | ||
168 | return new FactoryCallDefinition($decoratedServiceName, $className, $methodName, [$containerDefinition]); |
|
169 | } |
|
170 | ||
171 | // This is an object or a callback... we need to call the getServices method of the service provider at runtime. |
|
172 | return new CreateServiceFromRegistryDefinition($decoratedServiceName, $serviceName, $serviceProviderKey); |
|
@@ 189-197 (lines=9) @@ | ||
186 | if ($callable instanceof DefinitionInterface) { |
|
187 | return $this->converter->convert($decoratedServiceName, $callable); |
|
188 | } |
|
189 | if (is_array($callable) && is_string($callable[0])) { |
|
190 | return new FactoryCallDefinition($decoratedServiceName, $callable[0], $callable[1], [$containerDefinition, $previousDefinition]); |
|
191 | } elseif (is_string($callable) && strpos($callable, '::') !== false) { |
|
192 | $pos = strpos($callable, '::'); |
|
193 | $className = substr($callable, 0, $pos); |
|
194 | $methodName = substr($callable, $pos + 2); |
|
195 | ||
196 | return new FactoryCallDefinition($decoratedServiceName, $className, $methodName, [$containerDefinition, $previousDefinition]); |
|
197 | } |
|
198 | ||
199 | // This is an object or a callback... we need to call the getServices method of the service provider at runtime. |
|
200 | return new ExtendServiceFromRegistryDefinition($decoratedServiceName, $serviceName, $serviceProviderKey, $previousDefinition); |