public static function checkType($item)
    {
        if (is_string($item)) {
            // Item is a string; check to see if it's a URL or filepath
            if (filter_var($item, FILTER_VALIDATE_URL, FILTER_FLAG_PATH_REQUIRED)) {
                // Item is a URL
                return Type::URL;
            } elseif (is_file(config('filer.path.absolute') . "/{$item}")) {
                // Item is a filepath
                return Type::FILEPATH;
            }
        } elseif (is_a($item, 'SplFileInfo')) {
            // Item is a file object
            return Type::FILE;
        }

        // Throw an exception if item doesn't match any known types
        throw new Exception('Unknown item type');
    }
public static function checkType($item)
    {
        if (is_string($item)) {
            // Item is a string; check to see if it's a URL or filepath
            if (filter_var($item, FILTER_VALIDATE_URL, FILTER_FLAG_PATH_REQUIRED)) {
                // Item is a URL
                return Type::URL;
            } elseif (is_file(config('filer.path.absolute') . "/{$item}")) {
                // Item is a filepath
                return Type::FILEPATH;
            }
        } elseif (is_a($item, 'SplFileInfo')) {
            // Item is a file object
            return Type::FILE;
        }

        // Throw an exception if item doesn't match any known types
        throw new Exception('Unknown item type');
    }
public static function checkType ( $ item ) { if ( is_string ( $ item ) ) { // Item is a string; check to see if it's a URL or filepath if ( filter_var ( $ item , FILTER_VALIDATE_URL , FILTER_FLAG_PATH_REQUIRED ) ) { // Item is a URL return Type :: URL ; } elseif ( is_file ( config ( 'filer.path.absolute' ) . "/{$item}" ) ) { // Item is a filepath return Type :: FILEPATH ; } } elseif ( is_a ( $ item , 'SplFileInfo' ) ) { // Item is a file object return Type :: FILE ; } // Throw an exception if item doesn't match any known types throw new Exception ( 'Unknown item type' ) ; }
Attempts to determine what the given item is between a local filepath, a
local file object or a URL.

@param  mixed  $item
@return string
@throws Exception
Attempts to determine what the given item is between a local filepath a local file object or a URL .