You are here

public function DummyMatcher::execute in Linkit 8.5

Executes the matcher.

Parameters

string $string: The string that contains the text to search for.

Return value

\Drupal\linkit\Suggestion\SuggestionCollection A suggestion collection.

Overrides MatcherInterface::execute

File

tests/linkit_test/src/Plugin/Linkit/Matcher/DummyMatcher.php, line 22

Class

DummyMatcher
Provides test linkit matchers for the dummy_matcher entity type.

Namespace

Drupal\linkit_test\Plugin\Linkit\Matcher

Code

public function execute($string) {
  $suggestions = new SuggestionCollection();
  $suggestion = new SimpleSuggestion();
  $suggestion
    ->setLabel('Dummy Matcher title')
    ->setPath('http://example.com')
    ->setGroup('Dummy Matcher');
  $suggestions
    ->addSuggestion($suggestion);
  return $suggestions;
}