src/AssetFactory.php
public static function createFromSplFileInfo(\SplFileInfo $file)
    {
        $asset = new Asset();
        $guesser = MimeTypeGuesser::getInstance();
        return $asset
            ->setFilename($file->getFilename())
            ->setExtension($file->getExtension())
            ->setPathname($file->getPathname())
            ->setMimeType($guesser->guess($file->getPathname()))
            ->setClientOriginalName($file->getFilename())
            ->setClientOriginalExtension($file->getExtension())
        ;
    }
public static function createFromSplFileInfo(\SplFileInfo $file)
    {
        $asset = new Asset();
        $guesser = MimeTypeGuesser::getInstance();
        return $asset
            ->setFilename($file->getFilename())
            ->setExtension($file->getExtension())
            ->setPathname($file->getPathname())
            ->setMimeType($guesser->guess($file->getPathname()))
            ->setClientOriginalName($file->getFilename())
            ->setClientOriginalExtension($file->getExtension())
        ;
    }
public static function createFromSplFileInfo ( \ SplFileInfo $ file ) { $ asset = new Asset ( ) ; $ guesser = MimeTypeGuesser :: getInstance ( ) ; return $ asset -> setFilename ( $ file -> getFilename ( ) ) -> setExtension ( $ file -> getExtension ( ) ) -> setPathname ( $ file -> getPathname ( ) ) -> setMimeType ( $ guesser -> guess ( $ file -> getPathname ( ) ) ) -> setClientOriginalName ( $ file -> getFilename ( ) ) -> setClientOriginalExtension ( $ file -> getExtension ( ) ) ; }
Creates an Asset from a \SplFileInfo wrapper

@param   \SplFileInfo    $file
@throws  Exception\FactoryException  If the file could not be loaded
@return  Asset
Creates an Asset from a \ SplFileInfo wrapper