- usually watch closure implemented by extended classes
it's just simple resolver filter

@see LoaderNamespaceStack::resolve

@param string  $match        Resource Match Name
@param Closure $resolveWatch Watch Resource To Resolve

@return false|mixed
971015
protected function _t_loader_namespacestack_watchAndResolve($name, $match, $resolveWatch)
    {
        ($resolveWatch !== null) ?: $resolveWatch = function($resource) {
            return ($resource) ? $resource : false;
        };


        $this->_t_loader_namespacestack_fixResourceList($match);

        $return = false;
        foreach($this->_t_loader_namespacestack_Namespaces[$match] as $resource) {
            if ($return = $resolveWatch($name, $resource, $match))
                break;
        }

        return $return;
    }
1073612
private function resolvePregCallback($finded)
    {

        $matchEx = explode(' ', $this->getMatchUrl());
        $requestEx = explode(' ', $this->getRequestedUrl());
        $key = array_search($finded[0], $matchEx);
        $cln = $finded[1];

        if (strstr($cln, ':')) {
            list($cln, $filter) = explode(':', $cln);
        }

        if (!strstr($cln, '?')) {
            $add = isset($requestEx[$key]) && $requestEx[$key] !== '' ? $requestEx[$key] : false;
        } else {
            $add = isset($requestEx[$key]) ? $requestEx[$key] : null;
        }

        if($add !== null){
            // we gonna do run filter  now
            if (!$this->runFilter(isset($filter) ? $filter : $cln, $add)) {
                throw new FilterMatchException('Your filter do not match');
            }
        }

        $this->parameters[$cln] = $add;
    }
696515
File resolveProviderConflict(final Collection<FileCache.MemoFile> matched){
        final HashMap<File, VersionCompare> versions = new HashMap<File, VersionCompare>();
        final ArrayList<File> toCompare = new ArrayList<File>();
        for (final FileCache.MemoFile file : matched) {
            final String vers = getVersionForFile(file.getFile());
            if (null != vers) {
                versions.put(file.getFile(), VersionCompare.forString(vers));
                toCompare.add(file.getFile());
            }
        }
        //currently resolve via filename
        final Comparator<File> c = new VersionCompare.fileComparator(versions);
        final List<File> sorted = new ArrayList<File>(toCompare);
        Collections.sort(sorted, c);
        if (sorted.size() > 0) {
            return sorted.get(sorted.size() - 1);
        }
        return null;
    }
1166552
@SuppressWarnings("unchecked")
    static <T extends JUnitWatcher> Optional<T> getAttachedWatcher(Class<T> watcherType) {
        if (RunnerWatcher.class.isAssignableFrom(watcherType)) {
            synchronized(runnerWatcherLoader) {
                for (RunnerWatcher watcher : runnerWatcherLoader) {
                    if (watcher.getClass() == watcherType) {
                        return Optional.of((T) watcher);
                    }
                }
            }
        }
        return Optional.absent();
    }
850574
public function matching ($pattern, &$matches = [], $flags = 0, $offset = 0, $start = 0, $end = null) {
		if (is_null($end)) {
			$end = $this->_length;
		}
		return static::Match($pattern, static::Substring($this->_string, $start, $end), $matches, $flags, $offset);
	}
905593
private function evaluateBinding(
        string $alias,
        $target,
        array $parameters,
        string $context = null
    ) {
        if (is_string($target)) {
            //Reference
            return $this->make($target, $parameters, $context);
        }

        if ($target instanceof Autowire) {
            return $target->resolve($this, $parameters);
        }

        if ($target instanceof \Closure) {
            $reflection = new \ReflectionFunction($target);

            //Invoking Closure with resolved arguments
            return $reflection->invokeArgs(
                $this->resolveArguments($reflection, $parameters, $context)
            );
        }

        if (is_array($target) && isset($target[1])) {
            //In a form of resolver and method
            list($resolver, $method) = $target;

            //Resolver instance (i.e. [ClassName::class, 'method'])
            $resolver = $this->get($resolver);
            $method = new \ReflectionMethod($resolver, $method);
            $method->setAccessible(true);

            //Invoking factory method with resolved arguments
            return $method->invokeArgs(
                $resolver,
                $this->resolveArguments($method, $parameters, $context)
            );
        }

        throw new ContainerException("Invalid binding for '{$alias}'");
    }
692547
public function resolve(Closure $originalResolver, string $path)
    {
        $isDeferred = $this->isDeferred($path);
        $resolver = $isDeferred
            ? $this->deferred[$path]
            : $originalResolver;

        if ($isDeferred) {
            $this->resolved[] = $path;

            unset($this->deferred[$path]);
        }

        return $resolver();
    }
1027501
public boolean evaluate(Matcher rule, Matcher cond, Resolver resolver) {
        String value = test.evaluate(rule, cond, resolver);
        if (nocase) {
            value = value.toLowerCase(Locale.ENGLISH);
        }
        Condition condition = this.condition.get();
        if (condition == null) {
            if (condPattern.startsWith("<")) {
                LexicalCondition ncondition = new LexicalCondition();
                ncondition.type = -1;
                ncondition.condition = condPattern.substring(1);
                condition = ncondition;
            } else if (condPattern.startsWith(">")) {
                LexicalCondition ncondition = new LexicalCondition();
                ncondition.type = 1;
                ncondition.condition = condPattern.substring(1);
                condition = ncondition;
            } else if (condPattern.startsWith("=")) {
                LexicalCondition ncondition = new LexicalCondition();
                ncondition.type = 0;
                ncondition.condition = condPattern.substring(1);
                condition = ncondition;
            } else if (condPattern.equals("-d")) {
                ResourceCondition ncondition = new ResourceCondition();
                ncondition.type = 0;
                condition = ncondition;
            } else if (condPattern.equals("-f")) {
                ResourceCondition ncondition = new ResourceCondition();
                ncondition.type = 1;
                condition = ncondition;
            } else if (condPattern.equals("-s")) {
                ResourceCondition ncondition = new ResourceCondition();
                ncondition.type = 2;
                condition = ncondition;
            } else {
                PatternCondition ncondition = new PatternCondition();
                int flags = 0;
                if (isNocase()) {
                    flags |= Pattern.CASE_INSENSITIVE;
                }
                ncondition.pattern = Pattern.compile(condPattern, flags);
                condition = ncondition;
            }
            this.condition.set(condition);
        }
        if (positive) {
            return condition.evaluate(value, resolver);
        } else {
            return !condition.evaluate(value, resolver);
        }
    }
1742
function processWatches(items) {
  // queue up matches
  // { "member" : { "uri" : [ "match", "match" ] } }
  var toSend = {};
  GLOBAL.svc.indexer.retrieveWatches({}, function(err, res) {
    if (res.hits) {
      var watches = _.pluck(res.hits.hits, '_source');
      // for each hit
      items.forEach(function(item) {
        var matches = watchLib.matches(item, watches);
        if (matches.length) {
          matches.forEach(function(match) {
            toSend[match.member] = toSend[match.member] || {};
            toSend[match.member][item.uri] = toSend[match.member][item.uri] || [];
            toSend[match.member][item.uri].push(match.match);
          });
        }
      });
      send(toSend);
    }
  });
}
414549
public function getSnippet($match = null, $options = [])
    {
        if ($match !== null) {
            $this->_snippet = $this->fetchSnippet($match, $options);
        }

        return $this->_snippet;
    }
331786
private function getActionFromMatch($match = array())
    {
        $target = explode("#", $match["target"]);

        if (count($target) > 1) {
            return $target[1];
        }

        if (array_key_exists("action", $match["params"])) {
            return $this->getActionFromParam($match["params"]["action"]);
        }

        $this->controller->request = new Request();
        if (is_admin() && $this->controller->request->hasGet('page')) {
            return $this->controller->request->get('page');
            // When no method is sent, guesstimate from the action post value (ex: basic ajax)
        } elseif ($this->controller->request->hasPost('action')) {
            return $this->controller->request->post('action');
        }
    }
1000770
public function resolve($matches = [])
    {
        if (!isset($this->route['controller'])) {
            return false;
        }

        list($controller,) = explode('@', $this->route['controller']);

        $fileName = (new ReflectionClass($controller))->getFileName();
        $rootPath = substr($fileName, 0, strrpos($fileName, 'src'));
        $composerFilePath = $rootPath . 'composer.json';

        if($rootPath === '' || ! file_exists($composerFilePath)) {
            return false;
        }

        $this->package = $this->extensionFactory->getComposerPackage($composerFilePath);
        $this->name = $this->package->getName();

        return $this->name;
    }
251180
private function getTokenFromMatch($match)
    {
        $value = $match[0];
        $offset = $match[1];

        // If we don't match at the beginning of the string, it fails.
        if ($offset !== 0)
            return null;

        if ($this->value) $value = $this->value;

        return new Token($value, $this->tokenType, $match[0]);
    }
122679
function watchFilter(fileName) {
  var watchDirectory = this.watchDirectory,//this is array if multiple --watchDirectory options given, treat as array always
      result = true;

  if (!Array.isArray(watchDirectory)) {
    watchDirectory = [watchDirectory];
  }

  watchDirectory.forEach(function(directory) {
    var relFileName = path.relative(directory, fileName),
        length = this.watchIgnorePatterns.length,
        testName,
        i;

    if (this.watchIgnoreDotFiles && path.basename(fileName)[0] === '.') {
      result = false;
    }

    for (i = 0; i < length; i++) {
      if (this.watchIgnorePatterns[i].length > 0) {
        testName = (this.watchIgnorePatterns[i].charAt(0) !== '/') ? relFileName : fileName;
        if (minimatch(testName, this.watchIgnorePatterns[i], { matchBase: directory })) {
          result = false;
        }
      }
    }
  }.bind(this));

  return result;
}
748531
function resolve(pattern) {
      var token = pattern.slice(0, 1);

      if (this.is('rtl')) {
        return pattern.split(token).join(FLIPED_MOVEMENTS[token]);
      }

      return pattern;
    }
1269966
function _process_compiled_include_callback($match) {
		$_func = '_smarty_tplfunc_'.$match[2].'_'.$match[3];
		ob_start();
		$_func($this);
		$_ret = ob_get_contents();
		ob_end_clean();
		return $_ret;
	}
880286
public function resolveClass(SplFileInfo $fileInfo, Closure $callback = null)
    {
        /** @noinspection PhpIncludeInspection */
        require_once $fileInfo->getPathname();

        $instance = app()->make($this->getModuleClassName($fileInfo));

        if (is_callable($callback)) {
            $callback($instance);
        }
    }