lithium\core\Libraries::_searchPaths PHP Method

_searchPaths() protected static method

Returns the list of valid search path templates for the given service location lookup.
See also: lithium\core\Libraries::$_paths
See also: lithium\core\Libraries::_search()
protected static _searchPaths ( array $paths, string $library ) : array
$paths array The list of all possible path templates from `Libraries::$_paths`.
$library string The name of the library being searched.
return array Returns an array of valid path template strings.
    protected static function _searchPaths($paths, $library)
    {
        $result = array();
        foreach ($paths as $tpl => $opts) {
            if (is_int($tpl)) {
                $tpl = $opts;
                $opts = array();
            }
            if (isset($opts['libraries']) && !in_array($library, (array) $opts['libraries'])) {
                continue;
            }
            $result[] = $tpl;
        }
        return $result;
    }