1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Drupal\qa\Commands; |
4
|
|
|
|
5
|
|
|
use Drupal\qa\Controller\WorkflowsReportController; |
6
|
|
|
use Drupal\qa\Workflows\ContentModerationGraph; |
7
|
|
|
use Drupal\qa\Workflows\ContentModerationGrid; |
8
|
|
|
use Drush\Commands\DrushCommands; |
|
|
|
|
9
|
|
|
use OSInet\qa\ForceRemoved; |
10
|
|
|
use Symfony\Component\Yaml\Yaml; |
|
|
|
|
11
|
|
|
|
12
|
|
|
/** |
13
|
|
|
* A Drush commandfile. |
14
|
|
|
* |
15
|
|
|
* In addition to this file, you need a drush.services.yml |
16
|
|
|
* in root of your module, and a composer.json file that provides the name |
17
|
|
|
* of the services file to use. |
18
|
|
|
* |
19
|
|
|
* See these files for an example of injecting Drupal services: |
20
|
|
|
* - http://cgit.drupalcode.org/devel/tree/src/Commands/DevelCommands.php |
21
|
|
|
* - http://cgit.drupalcode.org/devel/tree/drush.services.yml |
22
|
|
|
*/ |
23
|
|
|
class QaCommands extends DrushCommands { |
24
|
|
|
|
25
|
|
|
/** |
26
|
|
|
* Show the content moderation as a table. |
27
|
|
|
* |
28
|
|
|
* |
29
|
|
|
* @command como:table |
30
|
|
|
* @aliases cmt,como-table |
31
|
|
|
*/ |
32
|
|
|
public function table() { |
33
|
|
|
$table = ContentModerationGrid::create(\Drupal::getContainer()); |
34
|
|
|
$table->report(); |
35
|
|
|
} |
36
|
|
|
|
37
|
|
|
/** |
38
|
|
|
* Show the content moderation as a Graphviz DOT file. |
39
|
|
|
* |
40
|
|
|
* @param $workflow |
41
|
|
|
* The machine name of a workflow |
42
|
|
|
* |
43
|
|
|
* @command como:graphviz |
44
|
|
|
* @aliases cmg,como-graphviz |
45
|
|
|
*/ |
46
|
|
|
public function graphviz($workflow = NULL) { |
47
|
|
|
$graph = ContentModerationGraph::create(\Drupal::getContainer()); |
48
|
|
|
echo $graph->report(); |
49
|
|
|
} |
50
|
|
|
|
51
|
|
|
|
52
|
|
|
/** |
53
|
|
|
* Show a summary of available workflows |
54
|
|
|
* |
55
|
|
|
* |
56
|
|
|
* @command qa:workflows-list |
57
|
|
|
* @aliases qawl,qa-workflows-list |
58
|
|
|
*/ |
59
|
|
|
public function workflowsList() { |
60
|
|
|
$listBuilder = WorkflowsReportController::create(\Drupal::getContainer()); |
61
|
|
|
$list = $listBuilder->getWorkflowSummary( |
62
|
|
|
$listBuilder->storage->loadMultiple() |
63
|
|
|
); |
64
|
|
|
$this->output->writeln(Yaml::dump($list)); |
65
|
|
|
} |
66
|
|
|
|
67
|
|
|
/** |
68
|
|
|
* Build a Graphviz DOT file showing the module and theme dependencies. |
69
|
|
|
* |
70
|
|
|
* |
71
|
|
|
* @command qa:dependencies |
72
|
|
|
* @aliases qadep,qa-dependencies |
73
|
|
|
*/ |
74
|
|
|
public function dependencies() { |
75
|
|
|
/** @var \Drupal\qa\Dependencies $qaDep */ |
76
|
|
|
$qaDep = \Drupal::service('qa.dependencies'); |
77
|
|
|
$G = $qaDep->build(); |
78
|
|
|
echo $G->build(); |
79
|
|
|
} |
80
|
|
|
|
81
|
|
|
/** |
82
|
|
|
* List extensions removed without a clean uninstall. |
83
|
|
|
* |
84
|
|
|
* |
85
|
|
|
* @command qa:force-removed |
86
|
|
|
* @aliases qafrm,qa-force-removed |
87
|
|
|
*/ |
88
|
|
|
public function forceRemoved() { |
89
|
|
|
$finder = ForceRemoved::create(); |
90
|
|
|
echo $finder->find(); |
91
|
|
|
} |
92
|
|
|
|
93
|
|
|
} |
94
|
|
|
|
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