|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
declare(strict_types=1); |
|
4
|
|
|
|
|
5
|
|
|
namespace Drupal\mongodb_watchdog\Command; |
|
6
|
|
|
|
|
7
|
|
|
use Drupal\Component\Serialization\Yaml; |
|
|
|
|
|
|
8
|
|
|
// @codingStandardsIgnoreLine |
|
9
|
|
|
use Drupal\Console\Annotations\DrupalCommand; |
|
|
|
|
|
|
10
|
|
|
use Drupal\Console\Core\Command\ContainerAwareCommand; |
|
|
|
|
|
|
11
|
|
|
use Drupal\mongodb_watchdog\Install\SanityCheck; |
|
12
|
|
|
use Symfony\Component\Console\Input\InputInterface; |
|
|
|
|
|
|
13
|
|
|
use Symfony\Component\Console\Output\OutputInterface; |
|
|
|
|
|
|
14
|
|
|
|
|
15
|
|
|
/** |
|
16
|
|
|
* Class SanityCheckCommand provides the mongodb:watchdog:sanitycheck command. |
|
17
|
|
|
* |
|
18
|
|
|
* @DrupalCommand ( |
|
19
|
|
|
* extension="mongodb_watchdog", |
|
20
|
|
|
* extensionType="module" |
|
21
|
|
|
* ) |
|
22
|
|
|
*/ |
|
23
|
|
|
class SanityCheckCommand extends ContainerAwareCommand { |
|
24
|
|
|
|
|
25
|
|
|
/** |
|
26
|
|
|
* The mongodb.watchdog.sanity_check service. |
|
27
|
|
|
* |
|
28
|
|
|
* @var \Drupal\mongodb_watchdog\Install\SanityCheck |
|
29
|
|
|
*/ |
|
30
|
|
|
protected $sanityCheck; |
|
31
|
|
|
|
|
32
|
|
|
/** |
|
33
|
|
|
* The serialisation.yaml service. |
|
34
|
|
|
* |
|
35
|
|
|
* @var \Drupal\Component\Serialization\Yaml |
|
36
|
|
|
*/ |
|
37
|
|
|
protected $yaml; |
|
38
|
|
|
|
|
39
|
|
|
/** |
|
40
|
|
|
* SanityCheckCommand constructor. |
|
41
|
|
|
* |
|
42
|
|
|
* @param \Drupal\mongodb_watchdog\Install\Sanitycheck $sanityCheck |
|
43
|
|
|
* The mongodb.watchdog.sanity_check service. |
|
44
|
|
|
* @param \Drupal\Component\Serialization\Yaml $yaml |
|
45
|
|
|
* The serialization.yaml service. |
|
46
|
|
|
*/ |
|
47
|
|
|
public function __construct(Sanitycheck $sanityCheck, Yaml $yaml) { |
|
48
|
|
|
parent::__construct(); |
|
49
|
|
|
$this->sanityCheck = $sanityCheck; |
|
50
|
|
|
$this->yaml = $yaml; |
|
51
|
|
|
} |
|
52
|
|
|
|
|
53
|
|
|
/** |
|
54
|
|
|
* {@inheritdoc} |
|
55
|
|
|
*/ |
|
56
|
|
|
protected function configure(): void { |
|
57
|
|
|
$this |
|
58
|
|
|
->setName('mongodb:watchdog:sanitycheck') |
|
59
|
|
|
->setDescription($this->trans('commands.mongodb.watchdog.sanitycheck.description')) |
|
60
|
|
|
->setHelp($this->trans('commands.mongodb.watchdog.sanitycheck.help')) |
|
61
|
|
|
->setAliases(['mdbwsc', 'mowd-sc']); |
|
62
|
|
|
} |
|
63
|
|
|
|
|
64
|
|
|
/** |
|
65
|
|
|
* {@inheritdoc} |
|
66
|
|
|
*/ |
|
67
|
|
|
protected function execute(InputInterface $input, OutputInterface $output): void { |
|
68
|
|
|
$buckets = $this->sanityCheck->buildCollectionstats(); |
|
69
|
|
|
$this->getIo()->writeln($this->yaml->encode($buckets)); |
|
70
|
|
|
} |
|
71
|
|
|
|
|
72
|
|
|
} |
|
73
|
|
|
|
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:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths