src/Filesystem.php
public function whatIs($pattern)
    {
        if (! $this->adapter->isAbsolute($pattern)) {
            $pattern = $this->rootPath . $pattern;
        }

        $paths = $this->adapter->glob($pattern);

        if (count($paths) == 0)
            return 'nothing';
        if (count($paths) == 1)
            return ($this->adapter->isFile($paths[0])) ? 'file' : 'dir';
        return 'collection';
    }
public function whatIs($pattern)
    {
        if (! $this->adapter->isAbsolute($pattern)) {
            $pattern = $this->rootPath . $pattern;
        }

        $paths = $this->adapter->glob($pattern);

        if (count($paths) == 0)
            return 'nothing';
        if (count($paths) == 1)
            return ($this->adapter->isFile($paths[0])) ? 'file' : 'dir';
        return 'collection';
    }
public function whatIs ( $ pattern ) { if ( ! $ this -> adapter -> isAbsolute ( $ pattern ) ) { $ pattern = $ this -> rootPath . $ pattern ; } $ paths = $ this -> adapter -> glob ( $ pattern ) ; if ( count ( $ paths ) == 0 ) return 'nothing' ; if ( count ( $ paths ) == 1 ) return ( $ this -> adapter -> isFile ( $ paths [ 0 ] ) ) ? 'file' : 'dir' ; return 'collection' ; }
Tells what is the given pattern matching, returns 'file' or 'dir' if a
single file or directory matches the pattern. Returns 'collection'
if there are multiple matches and 'nothing' if no match found.

@param  string  $pattern
@return string
Tells what is the given pattern matching returns file or dir if a single file or directory matches the pattern . Returns collection if there are multiple matches and nothing if no match found .