src/SDK/FileLoader.php
public static function load($file)
    {
        if (!File::isFile($file))
        {
            throw new NotFound\Path($file);
        }

        if (!File::isReadable($file))
        {
            throw new Exceptions\PermissionDenied($file);
        }

        $preg = PregMatch::first('~\.(?<ext>\w+)$~', $file);

        $class = Arr::get(
            static::$extensions,
            Arr::get($preg->matches, 'ext', 'php'),
            static::$extensions['php']
        );

        return new $class($file);
    }
public static function load($file)
    {
        if (!File::isFile($file))
        {
            throw new NotFound\Path($file);
        }

        if (!File::isReadable($file))
        {
            throw new Exceptions\PermissionDenied($file);
        }

        $preg = PregMatch::first('~\.(?<ext>\w+)$~', $file);

        $class = Arr::get(
            static::$extensions,
            Arr::get($preg->matches, 'ext', 'php'),
            static::$extensions['php']
        );

        return new $class($file);
    }
@param string $file

@return FileLoader\DataInterface

@throws NotFound\Path
@throws Exceptions\PermissionDenied