Version 1
[yaffs-website] / web / modules / contrib / linkit / tests / linkit_test / src / Plugin / Linkit / Matcher / DummyMatcher.php
diff --git a/web/modules/contrib/linkit/tests/linkit_test/src/Plugin/Linkit/Matcher/DummyMatcher.php b/web/modules/contrib/linkit/tests/linkit_test/src/Plugin/Linkit/Matcher/DummyMatcher.php
new file mode 100644 (file)
index 0000000..242e714
--- /dev/null
@@ -0,0 +1,47 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\linkit_test\Plugin\Linkit\Matcher\DummyMatcher.
+ */
+
+namespace Drupal\linkit_test\Plugin\Linkit\Matcher;
+
+use Drupal\linkit\MatcherBase;
+use Symfony\Component\DependencyInjection\ContainerInterface;
+
+
+/**
+ * @Matcher(
+ *   id = "dummy_matcher",
+ *   label = @Translation("Dummy Matcher"),
+ * )
+ */
+class DummyMatcher extends MatcherBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
+    return new static(
+      $configuration,
+      $plugin_id,
+      $plugin_definition
+    );
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function getMatches($string) {
+    $matches[] = [
+      'title' => 'DummyMatcher title',
+      'description' => 'DummyMatcher description',
+      'path' => 'http://example.com',
+      'group' => 'DummyMatcher',
+    ];
+
+    return $matches;
+  }
+
+}