src/Core/Injector/Injector.php
public function get($name, $asSingleton = true, $constructorArgs = [])
    {
        $object = $this->getNamedService($name, $asSingleton, $constructorArgs);

        if (!$object) {
            throw new InjectorNotFoundException("The '{$name}' service could not be found");
        }

        return $object;
    }
public function get($name, $asSingleton = true, $constructorArgs = [])
    {
        $object = $this->getNamedService($name, $asSingleton, $constructorArgs);

        if (!$object) {
            throw new InjectorNotFoundException("The '{$name}' service could not be found");
        }

        return $object;
    }
public function get ( $ name , $ asSingleton = true , $ constructorArgs = [ ] ) { $ object = $ this -> getNamedService ( $ name , $ asSingleton , $ constructorArgs ) ; if ( ! $ object ) { throw new InjectorNotFoundException ( "The '{$name}' service could not be found" ) ; } return $ object ; }
Get a named managed object

Will first check to see if the item has been registered as a configured service/bean
and return that if so.

Next, will check to see if there's any registered configuration for the given type
and will then try and load that

Failing all of that, will just return a new instance of the specified object.

@throws NotFoundExceptionInterface  No entry was found for **this** identifier.

@param string $name The name of the service to retrieve. If not a registered
service, then a class of the given name is instantiated
@param bool $asSingleton If set to false a new instance will be returned.
If true a singleton will be returned unless the spec is type=prototype'
@param array $constructorArgs Args to pass in to the constructor. Note: Ignored for singletons
@return mixed Instance of the specified object
Get a named managed object