public static function get(string $class, array $config = [])
    {
        $reflection = new \ReflectionClass($class);

        if (!$reflection->isInstantiable()) {
            throw new \ReflectionException(sprintf('`%s` is not instantiable.', $reflection->name));
        }
        if ($reflection->implementsInterface(IConfigurable::class)) {
            // set $config as the last parameter (existing one will be overwritten)
            return $reflection->newInstanceArgs([$config]);
        }

        $object = $reflection->newInstance();
        static::configure($object, $config);

        return $object;
    }