public function get(string $key): Type
    {
        if ($this->customTypes && $this->customTypes->has($key)) {
            $t = $this->customTypes->get($key);
            $this->registerInstance($t);

            return $t;
        }

        if (array_key_exists($key, $this->types)) {
            return $this->types[$key];
        }

        throw new Exception('No type registered with key `' . $key . '`. Either correct the usage, or register it in your custom types container when instantiating `' . self::class . '`.');
    }
public function get(string $key): Type
    {
        if ($this->customTypes && $this->customTypes->has($key)) {
            $t = $this->customTypes->get($key);
            $this->registerInstance($t);

            return $t;
        }

        if (array_key_exists($key, $this->types)) {
            return $this->types[$key];
        }

        throw new Exception('No type registered with key `' . $key . '`. Either correct the usage, or register it in your custom types container when instantiating `' . self::class . '`.');
    }
public function get ( string $ key ) : Type { if ( $ this -> customTypes && $ this -> customTypes -> has ( $ key ) ) { $ t = $ this -> customTypes -> get ( $ key ) ; $ this -> registerInstance ( $ t ) ; return $ t ; } if ( array_key_exists ( $ key , $ this -> types ) ) { return $ this -> types [ $ key ] ; } throw new Exception ( 'No type registered with key `' . $ key . '`. Either correct the usage, or register it in your custom types container when instantiating `' . self :: class . '`.' ) ; }
Always return the same instance of `Type` for the given key

It will first look for the type in the custom types container, and then
use automatically generated types. This allow for custom types to override
automatic ones.

@param string $key the key the type was registered with (eg: "Post", "PostInput", "PostPartialInput" or "PostStatus")

@return Type
Always return the same instance of Type for the given key