Checks if scenario or outline matches specified filter.

@param ScenarioInterface $scenario Scenario or Outline node instance

@return Boolean
11496
public function isScenarioMatch(ScenarioInterface $scenario)
    {
        if ('/' === $this->filterString[0] && 1 === preg_match($this->filterString, $scenario->getTitle())) {
            return true;
        } elseif (false !== mb_strpos($scenario->getTitle(), $this->filterString, 0, 'utf8')) {
            return true;
        }

        return false;
    }
1244649
public function matches_all_filters(\context $context) {
        $filters = helper::get_all_filters();

        // All filters must match.
        // If any one filter fails to match, we return false.
        foreach ($filters as $filterclass) {
            if (!$filterclass::filter_matches($this, $context)) {
                return false;
            }
        }

        return true;
    }
1035928
public function filterFeature(FeatureNode $feature)
    {
        $scenarios = array();
        foreach ($feature->getScenarios() as $scenario) {
            if (!$this->isScenarioMatch($scenario)) {
                continue;
            }

            if ($scenario instanceof OutlineNode && $scenario->hasExamples()) {
                $table = $scenario->getExampleTable()->getTable();
                $lines = array_keys($table);

                $filteredTable = array($lines[0] => $table[$lines[0]]);
                unset($table[$lines[0]]);

                foreach ($table as $line => $row) {
                    if ($this->filterMinLine <= $line && $this->filterMaxLine >= $line) {
                        $filteredTable[$line] = $row;
                    }
                }

                $scenario = new OutlineNode(
                    $scenario->getTitle(),
                    $scenario->getTags(),
                    $scenario->getSteps(),
                    new ExampleTableNode($filteredTable, $scenario->getExampleTable()->getKeyword()),
                    $scenario->getKeyword(),
                    $scenario->getLine()
                );
            }

            $scenarios[] = $scenario;
        }

        return new FeatureNode(
            $feature->getTitle(),
            $feature->getDescription(),
            $feature->getTags(),
            $feature->getBackground(),
            $scenarios,
            $feature->getKeyword(),
            $feature->getLanguage(),
            $feature->getFile(),
            $feature->getLine()
        );
    }
558958
public function containsRange(RangeInterface $range)
    {
        $result = false;
        if ($range->getAddressType() === $this->getAddressType()) {
            if ($range->toString(false) === $this->toString(false)) {
                $result = true;
            }
        }

        return $result;
    }
966058
public function contains(DirectiveInterface $directive)
    {
        foreach ($this->directives as $existingDirective) {
            if ($directive->equals($existingDirective)) {
                return true;
            }
        }

        return false;
    }
869011
public function matchRequest(\TYPO3\Flow\Mvc\RequestInterface $request) {
		/** @var \TYPO3\Flow\Security\RequestPatternInterface $pattern */
		foreach ($this->subPatterns as $pattern) {
			if ($pattern->matchRequest($request) === FALSE) {
				return FALSE;
			}
		}

		return TRUE;
	}
539136
function matches (Component $component)
  {
    if ($this->matchTag && $this->matchTag !== $component->getTagName ())
      return false;
    if ($this->matchClass &&
        (!$component instanceof HtmlComponent || !preg_match ($this->matchClass, $component->props->class))
    )
      return false;
    if ($component->supportsProperties () && ($prop = $this->matchPropName)) {
      if (!$component->props->defines ($prop))
        return false;
      if ($this->matchPropValue !== '') {
        if ($component->props->$prop != $this->matchPropValue)
          return false;
      }
      else if (!exists ($component->props->$prop))
        return false;
    }
    return true;
  }
809727
public static function match($scenario1, $scenario2)
	{
		$match1 = $match2 = [];
		if ( preg_match_all('/([^\\}{]*)\{([^\{\}]+)\}/', $scenario1, $match1, PREG_SET_ORDER) &&
			   preg_match_all('/([^\\}{]*)\{([^\{\}]+)\}/', $scenario2, $match2, PREG_SET_ORDER) ) {

			if ( count($match1) != count($match2) ) {
				return false;
			}
			for ($i = 0; $i < count($match1); $i++) {
				if ( str_replace(' ', '', $match1[$i][1]) != str_replace(' ', '', $match2[$i][1]) ) {
					return false;
				}
				if ( $match1[$i][2] != $match2[$i][2] &&  $match1[$i][2] != '*' && $match2[$i][2] != '*' ) {
					return false;
				}
			}
		} else {
			return false;
		}
		return true;
	}
651234
protected function isMatchNameFilter(ScenarioInterface $scenario, $filterString)
    {
        $filter = new NameFilter($filterString);

        return $filter->isScenarioMatch($scenario);
    }
965613
public function match(AddressInterface $address)
    {
        foreach ($this->territories as $territory) {
            if ($territory->match($address)) {
                return true;
            }
        }
        return false;
    }
1024510
protected function hasConditionAndConditionNotMatched(CommandInterface $command): bool
    {
        if (!$this->isConditionalCommand($command) || $this->conditionMatched($command)) {
            return false;
        }

        return true;
    }
1331208
public function calculateScenarioHeaderWidth(Scenario $scenario, $indentation)
    {
        $indentText = str_repeat(' ', intval($indentation));

        if ($scenario instanceof ExampleNode) {
            $header = sprintf('%s%s', $indentText, $scenario->getTitle());
        } else {
            $title = $scenario->getTitle();
            $lines = explode("\n", $title);
            $header = sprintf('%s%s: %s', $indentText, $scenario->getKeyword(), array_shift($lines));
        }

        return mb_strlen(rtrim($header), 'utf8');
    }
269837
protected function isPatternMatch(CdnConfiguration $configuration, $imagePath)
    {
        if (empty($configuration->getPathPatterns())) {
            return true;
        }

        foreach ($configuration->getPathPatterns() as $pattern) {
            if (preg_match(sprintf('~%s~', $pattern), $imagePath)) {
                return true;
            }
        }

        return false;
    }
132741
public function contains(TransitionInterface $transition): bool
    {
        foreach ($this->internal_set as $cur_transition) {
            if ($cur_transition->getFrom() === $transition->getFrom()
                && $cur_transition->getTo() === $transition->getTo()
            ) {
                return true;
            }
        }
        return false;
    }
925925
public function filter(MatcherInterface $matcher)
    {
        if ($matcher instanceof ArrayExcludeMatcher) {
            $this->data = array_diff($this->data, $matcher->getExcludes());
            return;
        }

        $this->data = array_filter($this->data, function ($row) use ($matcher) {
            return $matcher->match($row);
        });
    }
193508
public static boolean matches(Pattern patternMatcher, Collection<Filter> filters, Extension extension)
    {
        if (matches(patternMatcher, extension.getId().getId(), extension.getDescription(), extension.getSummary(),
            extension.getName(), ExtensionIdConverter.toStringList(extension.getExtensionFeatures()))) {
            for (Filter filter : filters) {
                if (!matches(filter, extension)) {
                    return false;
                }
            }

            return true;
        }

        return false;
    }
371390
public function matchesPattern($event, $pattern)
    {
        if ($pattern === '*') {
            return true;
        }

        if ($event == $pattern) {
            return true;
        }

        return fnmatch($pattern, $event);
    }