public function scanLocations(array $criteria)
    {
        $uris = $this->locations->map(function ($location) use ($criteria) {
            /** @var Location $location */
            return $location->getURI($criteria);
        })->filter(function ($uri) {
            return false !== $uri;
        });
        
        // Fall back for absolute paths on current filesystem.
        if ($uris->isEmpty()) {
            foreach ($criteria as $criterion) {
                if (file_exists($criterion)) {
                    return $criterion;
                }
            }
        }

        return $uris->isEmpty() ? false : $uris->first();
    }
public function scanLocations(array $criteria)
    {
        $uris = $this->locations->map(function ($location) use ($criteria) {
            /** @var Location $location */
            return $location->getURI($criteria);
        })->filter(function ($uri) {
            return false !== $uri;
        });
        
        // Fall back for absolute paths on current filesystem.
        if ($uris->isEmpty()) {
            foreach ($criteria as $criterion) {
                if (file_exists($criterion)) {
                    return $criterion;
                }
            }
        }

        return $uris->isEmpty() ? false : $uris->first();
    }
public function scanLocations ( array $ criteria ) { $ uris = $ this -> locations -> map ( function ( $ location ) use ( $ criteria ) { /** @var Location $location */ return $ location -> getURI ( $ criteria ) ; } ) -> filter ( function ( $ uri ) { return false !== $ uri ; } ) ; // Fall back for absolute paths on current filesystem. if ( $ uris -> isEmpty ( ) ) { foreach ( $ criteria as $ criterion ) { if ( file_exists ( $ criterion ) ) { return $ criterion ; } } } return $ uris -> isEmpty ( ) ? false : $ uris -> first ( ) ; }
Scan Locations for an URI that matches the specified criteria.

@since 0.1.0

@param array $criteria Criteria to match.

@return string|false URI of the requested view, or false if not found.
Scan Locations for an URI that matches the specified criteria .