Passed
Pull Request — 8.x-1.x (#11)
by Frédéric G.
01:15
created

QaCheckManager::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 5
rs 10
cc 1
nc 1
nop 3
1
<?php
2
3
namespace Drupal\qa\Plugin;
4
5
use Drupal\Core\Plugin\DefaultPluginManager;
0 ignored issues
show
Bug introduced by
The type Drupal\Core\Plugin\DefaultPluginManager was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
6
use Drupal\Core\Cache\CacheBackendInterface;
0 ignored issues
show
Bug introduced by
The type Drupal\Core\Cache\CacheBackendInterface was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
7
use Drupal\Core\Extension\ModuleHandlerInterface;
0 ignored issues
show
Bug introduced by
The type Drupal\Core\Extension\ModuleHandlerInterface was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
8
use Drupal\qa\Annotation\QaCheck;
9
10
/**
11
 * Provides the QA Check plugin manager.
12
 */
13
class QaCheckManager extends DefaultPluginManager {
14
15
16
  /**
17
   * Constructs a new QaCheckManager object.
18
   *
19
   * @param \Traversable $namespaces
20
   *   An object that implements \Traversable which contains the root paths
21
   *   keyed by the corresponding namespace to look for plugin implementations.
22
   * @param \Drupal\Core\Cache\CacheBackendInterface $cache_backend
23
   *   Cache backend instance to use.
24
   * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
25
   *   The module handler to invoke the alter hook with.
26
   */
27
  public function __construct(\Traversable $namespaces, CacheBackendInterface $cache_backend, ModuleHandlerInterface $module_handler) {
28
    parent::__construct('Plugin/QaCheck', $namespaces, $module_handler, QaCheckInterface::class, QaCheck::class);
29
30
    $this->alterInfo('qa_qa_check_info');
31
    $this->setCacheBackend($cache_backend, 'qa_qa_check_plugins');
32
  }
33
34
}
35