summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmil Stjerneman2018-12-28 02:45:09 (GMT)
committerEmil Stjerneman2018-12-28 02:45:09 (GMT)
commit6f8fc9392601f18f4aad49b5daa5c33d06014d41 (patch)
tree8da9655c9463cfddcd2b6bfce78f726ea72a15e6
parentd5e99ddbeb65058723acbb6788907c1273221ae0 (diff)
by anon: Fixed some code quality issues
-rw-r--r--src/Plugin/Linkit/Matcher/EntityMatcher.php4
-rw-r--r--src/Plugin/Linkit/Substitution/Media.php14
-rw-r--r--tests/src/Kernel/LinkitAutocompleteTest.php2
3 files changed, 3 insertions, 17 deletions
diff --git a/src/Plugin/Linkit/Matcher/EntityMatcher.php b/src/Plugin/Linkit/Matcher/EntityMatcher.php
index 4231b50..9d56a47 100644
--- a/src/Plugin/Linkit/Matcher/EntityMatcher.php
+++ b/src/Plugin/Linkit/Matcher/EntityMatcher.php
@@ -167,7 +167,7 @@ class EntityMatcher extends ConfigurableMatcherBase {
'@bundle_grouping' => $this->configuration['group_by_bundle'] ? $this->t('Yes') : $this->t('No'),
]);
- if(!empty($configuration['limit'])){
+ if (!empty($this->configuration['limit'])) {
$summery[] = $this->t('Limit: @limit', [
'@limit' => $this->configuration['limit'],
]);
@@ -385,7 +385,7 @@ class EntityMatcher extends ConfigurableMatcherBase {
$query->condition($bundle_key, $this->configuration['bundles'], 'IN');
}
- if($this->configuration['limit']){
+ if ($this->configuration['limit']) {
$query->range(0, $this->configuration['limit']);
}
$this->addQueryTags($query);
diff --git a/src/Plugin/Linkit/Substitution/Media.php b/src/Plugin/Linkit/Substitution/Media.php
index 75221c2..be593f8 100644
--- a/src/Plugin/Linkit/Substitution/Media.php
+++ b/src/Plugin/Linkit/Substitution/Media.php
@@ -21,20 +21,6 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
class Media extends PluginBase implements SubstitutionInterface, ContainerFactoryPluginInterface {
/**
- * Constructs a Media object.
- *
- * @param array $configuration
- * A configuration array containing information about the plugin instance.
- * @param string $plugin_id
- * The plugin_id for the plugin instance.
- * @param mixed $plugin_definition
- * The plugin implementation definition.
- */
- public function __construct(array $configuration, $plugin_id, $plugin_definition) {
- parent::__construct($configuration, $plugin_id, $plugin_definition);
- }
-
- /**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
diff --git a/tests/src/Kernel/LinkitAutocompleteTest.php b/tests/src/Kernel/LinkitAutocompleteTest.php
index e74d87e..df6c2ab 100644
--- a/tests/src/Kernel/LinkitAutocompleteTest.php
+++ b/tests/src/Kernel/LinkitAutocompleteTest.php
@@ -155,7 +155,7 @@ class LinkitAutocompleteTest extends LinkitKernelTestBase {
/**
* Tests autocompletion with results limit.
*/
- public function testAutocompletionWithLimit(){
+ public function testAutocompletionWithLimit() {
/** @var \Drupal\linkit\MatcherInterface $plugin */
$plugin = $this->matcherManager->createInstance('entity:entity_test');
$configuration = $plugin->getConfiguration();