lib/Registry/Registry.php
public function setService($name, $object)
    {
        if (isset($this->services[$name])) {
            throw new \InvalidArgumentException(sprintf(
                '%s service "%s" already exists.',
                $this->serviceType,
                $name
            ));
        }

        $this->services[$name] = $object;
    }
public function setService($name, $object)
    {
        if (isset($this->services[$name])) {
            throw new \InvalidArgumentException(sprintf(
                '%s service "%s" already exists.',
                $this->serviceType,
                $name
            ));
        }

        $this->services[$name] = $object;
    }
public function setService ( $ name , $ object ) { if ( isset ( $ this -> services [ $ name ] ) ) { throw new \ InvalidArgumentException ( sprintf ( '%s service "%s" already exists.' , $ this -> serviceType , $ name ) ) ; } $ this -> services [ $ name ] = $ object ; }
Directly set a named service.

@param string $name
@param object $object
Directly set a named service .