src/PeekAndPoke/Aviator/Config/ConfigBase.php
public function getAs(string $key, string $configClass, array $default = []) : Config
    {
        $data = $this->get($key, $default);

        if (! is_a($configClass, Config::class, true)) {

            $configInterface = Config::class;

            throw new \InvalidArgumentException("The given config-class '$configClass' does not implements $configInterface, but is has to.");
        }

        return new $configClass($data);
    }
public function getAs(string $key, string $configClass, array $default = []) : Config
    {
        $data = $this->get($key, $default);

        if (! is_a($configClass, Config::class, true)) {

            $configInterface = Config::class;

            throw new \InvalidArgumentException("The given config-class '$configClass' does not implements $configInterface, but is has to.");
        }

        return new $configClass($data);
    }
@inheritdoc

@param string $key
@param string $configClass
@param array  $default

@return Config