Factory/AssetFactory.php
public function create(\SplFileInfo $file)
    {
        $extension = $file->getExtension();
        switch ($extension) {
            case 'css':
                return new StylesheetDocument();
            case 'js':
                return new JavascriptDocument();
            default:
                if (strstr($this->getMimeType($file), 'image')) {
                    return new ImageDocument();
                }

                return new FileDocument();
        }
    }
public function create(\SplFileInfo $file)
    {
        $extension = $file->getExtension();
        switch ($extension) {
            case 'css':
                return new StylesheetDocument();
            case 'js':
                return new JavascriptDocument();
            default:
                if (strstr($this->getMimeType($file), 'image')) {
                    return new ImageDocument();
                }

                return new FileDocument();
        }
    }
public function create ( \ SplFileInfo $ file ) { $ extension = $ file -> getExtension ( ) ; switch ( $ extension ) { case 'css' : return new StylesheetDocument ( ) ; case 'js' : return new JavascriptDocument ( ) ; default : if ( strstr ( $ this -> getMimeType ( $ file ) , 'image' ) ) { return new ImageDocument ( ) ; } return new FileDocument ( ) ; } }
Returns a new instance of the Document that matches the type of the file passed in

@param \SplFileInfo $file
@return FileInterface
Returns a new instance of the Document that matches the type of the file passed in