public static function fromArray(array $file): self
    {
        $url = $file['file_ext'] === 'zip'
            ? $file['large_file_url']
            : $file['file_url'];

        return new self(
            $file['file_size'],
            $url,
            self::getFileTypeByExtension($file['file_ext']),
            $file['image_width'],
            $file['image_height']
        );
    }
public static function fromArray(array $file): self
    {
        $url = $file['file_ext'] === 'zip'
            ? $file['large_file_url']
            : $file['file_url'];

        return new self(
            $file['file_size'],
            $url,
            self::getFileTypeByExtension($file['file_ext']),
            $file['image_width'],
            $file['image_height']
        );
    }
public static function fromArray ( array $ file ) : self { $ url = $ file [ 'file_ext' ] === 'zip' ? $ file [ 'large_file_url' ] : $ file [ 'file_url' ] ; return new self ( $ file [ 'file_size' ] , $ url , self :: getFileTypeByExtension ( $ file [ 'file_ext' ] ) , $ file [ 'image_width' ] , $ file [ 'image_height' ] ) ; }
Creates File instance from API response.

@param array $file

@return File
Creates File instance from API response .