Code Duplication    Length = 9-9 lines in 2 locations

src/ServiceProvider/ServiceProviderLoader.php 2 locations

@@ 151-159 (lines=9) @@
148
        if ($callable instanceof DefinitionInterface) {
149
            return $this->converter->convert($decoratedServiceName, $callable);
150
        }
151
        if (is_array($callable) && is_string($callable[0])) {
152
            return new FactoryCallDefinition($decoratedServiceName, $callable[0], $callable[1], [$containerDefinition]);
153
        } elseif (is_string($callable) && strpos($callable, '::') !== false) {
154
            $pos = strpos($callable, '::');
155
            $className = substr($callable, 0, $pos);
156
            $methodName = substr($callable, $pos + 2);
157
158
            return new FactoryCallDefinition($decoratedServiceName, $className, $methodName, [$containerDefinition]);
159
        }
160
161
        // This is an object or a callback... we need to call the getServices method of the service provider at runtime.
162
        return new CreateServiceFromRegistryDefinition($decoratedServiceName, $serviceName, $serviceProviderKey);
@@ 181-189 (lines=9) @@
178
        if ($callable instanceof DefinitionInterface) {
179
            return $this->converter->convert($decoratedServiceName, $callable);
180
        }
181
        if (is_array($callable) && is_string($callable[0])) {
182
            return new FactoryCallDefinition($decoratedServiceName, $callable[0], $callable[1], [$containerDefinition, $previousDefinition]);
183
        } elseif (is_string($callable) && strpos($callable, '::') !== false) {
184
            $pos = strpos($callable, '::');
185
            $className = substr($callable, 0, $pos);
186
            $methodName = substr($callable, $pos + 2);
187
188
            return new FactoryCallDefinition($decoratedServiceName, $className, $methodName, [$containerDefinition, $previousDefinition]);
189
        }
190
191
        // This is an object or a callback... we need to call the getServices method of the service provider at runtime.
192
        return new ExtendServiceFromRegistryDefinition($decoratedServiceName, $serviceName, $serviceProviderKey, $previousDefinition);