src/Core/Injector/Injector.php
public function getServiceName($name)
    {
        // Lazy load in spec (disable inheritance to check exact service name)
        if ($this->getServiceSpec($name, false)) {
            return $name;
        }

        // okay, check whether we've got a compound name - don't worry about 0 index, cause that's an
        // invalid name
        if (!strpos($name, '.')) {
            return null;
        }

        return $this->getServiceName(substr($name, 0, strrpos($name, '.')));
    }
public function getServiceName($name)
    {
        // Lazy load in spec (disable inheritance to check exact service name)
        if ($this->getServiceSpec($name, false)) {
            return $name;
        }

        // okay, check whether we've got a compound name - don't worry about 0 index, cause that's an
        // invalid name
        if (!strpos($name, '.')) {
            return null;
        }

        return $this->getServiceName(substr($name, 0, strrpos($name, '.')));
    }
public function getServiceName ( $ name ) { // Lazy load in spec (disable inheritance to check exact service name) if ( $ this -> getServiceSpec ( $ name , false ) ) { return $ name ; } // okay, check whether we've got a compound name - don't worry about 0 index, cause that's an // invalid name if ( ! strpos ( $ name , '.' ) ) { return null ; } return $ this -> getServiceName ( substr ( $ name , 0 , strrpos ( $ name , '.' ) ) ) ; }
Does the given service exist, and if so, what's the stored name for it?

We do a special check here for services that are using compound names. For example,
we might want to say that a property should be injected with Log.File or Log.Memory,
but have only registered a 'Log' service, we'll instead return that.

Will recursively call itself for each depth of dotting.

@param string $name
@return string|null The name of the service (as it might be different from the one passed in)
Does the given service exist and if so what s the stored name for it?