final public function get(string $type): object
    {
        if ($this->supports($type)) {
            $ret = $this->getObject($type);
            if ($ret instanceof $type) {
                return $ret;
            }
            throw new TypeError;
        }

        throw new UnavailableTypeException;
    }
final public function get(string $type): object
    {
        if ($this->supports($type)) {
            $ret = $this->getObject($type);
            if ($ret instanceof $type) {
                return $ret;
            }
            throw new TypeError;
        }

        throw new UnavailableTypeException;
    }
final public function get ( string $ type ) : object { if ( $ this -> supports ( $ type ) ) { $ ret = $ this -> getObject ( $ type ) ; if ( $ ret instanceof $ type ) { return $ ret ; } throw new TypeError ; } throw new UnavailableTypeException ; }
Get an object of the type.

Check if the type is supported.
If the type is supported, call getObject.
If not, throw an exception.

@param string $type
@return object

@throws TypeError
@throws UnavailableTypeException
Get an object of the type .