public function locate($file, $first = true)
    {
        $paths = array();

        foreach ($this->locators as $locator) {
            if (null !== ($found = $locator->locate($file, $first))) {
                if ($first) {
                    return $found;
                }

                $paths = array_merge($paths, $found);
            }
        }

        return $first ? null : array_values(array_unique($paths));
    }
public function locate($file, $first = true)
    {
        $paths = array();

        foreach ($this->locators as $locator) {
            if (null !== ($found = $locator->locate($file, $first))) {
                if ($first) {
                    return $found;
                }

                $paths = array_merge($paths, $found);
            }
        }

        return $first ? null : array_values(array_unique($paths));
    }
public function locate ( $ file , $ first = true ) { $ paths = array ( ) ; foreach ( $ this -> locators as $ locator ) { if ( null !== ( $ found = $ locator -> locate ( $ file , $ first ) ) ) { if ( $ first ) { return $ found ; } $ paths = array_merge ( $ paths , $ found ) ; } } return $ first ? null : array_values ( array_unique ( $ paths ) ) ; }
Locates a file using the locators in the collection.

@param string  $file  The file name.
@param boolean $first Only return first result?

@return array|string The file path or list of file paths.
Locates a file using the locators in the collection .