src/Container.php
private function initializeService($service, $name, array $callDefinitions)
    {
        foreach ($callDefinitions as $callDefinition) {
            if (!is_array($callDefinition) || !isset($callDefinition['method'])) {
                throw new ContainerException($name.' service calls must be arrays containing a \'method\' key');
            } elseif (!is_callable([$service, $callDefinition['method']])) {
                throw new ContainerException($name.' service asks for call to uncallable method: '.$callDefinition['method']);
            }

            $arguments = isset($callDefinition['arguments']) ? $this->resolveArguments($callDefinition['arguments']) : [];

            call_user_func_array([$service, $callDefinition['method']], $arguments);
        }
    }
private function initializeService($service, $name, array $callDefinitions)
    {
        foreach ($callDefinitions as $callDefinition) {
            if (!is_array($callDefinition) || !isset($callDefinition['method'])) {
                throw new ContainerException($name.' service calls must be arrays containing a \'method\' key');
            } elseif (!is_callable([$service, $callDefinition['method']])) {
                throw new ContainerException($name.' service asks for call to uncallable method: '.$callDefinition['method']);
            }

            $arguments = isset($callDefinition['arguments']) ? $this->resolveArguments($callDefinition['arguments']) : [];

            call_user_func_array([$service, $callDefinition['method']], $arguments);
        }
    }
private function initializeService ( $ service , $ name , array $ callDefinitions ) { foreach ( $ callDefinitions as $ callDefinition ) { if ( ! is_array ( $ callDefinition ) || ! isset ( $ callDefinition [ 'method' ] ) ) { throw new ContainerException ( $ name . ' service calls must be arrays containing a \'method\' key' ) ; } elseif ( ! is_callable ( [ $ service , $ callDefinition [ 'method' ] ] ) ) { throw new ContainerException ( $ name . ' service asks for call to uncallable method: ' . $ callDefinition [ 'method' ] ) ; } $ arguments = isset ( $ callDefinition [ 'arguments' ] ) ? $ this -> resolveArguments ( $ callDefinition [ 'arguments' ] ) : [ ] ; call_user_func_array ( [ $ service , $ callDefinition [ 'method' ] ] , $ arguments ) ; } }
Initialize a service using the call definitions.

@param object $service         The service.
@param string $name            The service name.
@param array  $callDefinitions The service calls definition.

@throws ContainerException On failure.
Initialize a service using the call definitions .