src/Core/Injector/Injector.php
public function registerService($service, $replace = null)
    {
        $registerAt = get_class($service);
        if ($replace !== null) {
            $registerAt = $replace;
        }

        $this->specs[$registerAt] = array('class' => get_class($service));
        $this->serviceCache[$registerAt] = $service;
        return $this;
    }
public function registerService($service, $replace = null)
    {
        $registerAt = get_class($service);
        if ($replace !== null) {
            $registerAt = $replace;
        }

        $this->specs[$registerAt] = array('class' => get_class($service));
        $this->serviceCache[$registerAt] = $service;
        return $this;
    }
public function registerService ( $ service , $ replace = null ) { $ registerAt = get_class ( $ service ) ; if ( $ replace !== null ) { $ registerAt = $ replace ; } $ this -> specs [ $ registerAt ] = array ( 'class' => get_class ( $ service ) ) ; $ this -> serviceCache [ $ registerAt ] = $ service ; return $ this ; }
Register a service object with an optional name to register it as the
service for

@param object $service The object to register
@param string $replace The name of the object to replace (if different to the
class name of the object to register)
@return $this
Register a service object with an optional name to register it as the service for