You are here

public function ConfigurableDummyMatcher::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/ConfigurableDummyMatcher.php, line 58

Class

ConfigurableDummyMatcher
Provides test linkit matchers for the configurable_dummy_matcher entity type.

Namespace

Drupal\linkit_test\Plugin\Linkit\Matcher

Code

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