Skip to content

Commit 5fbeabd

Browse files
committed
Add Drupal project support
1 parent bd93454 commit 5fbeabd

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,10 @@ $ phpqa analyze --project=PROJECT --files[=FILES]
8787

8888
| Option | Description |
8989
| ------- | ----------------------------- |
90-
| project | Available default values php, symfony |
90+
| project | Available default values `php`, `symfony` and `drupal` |
9191
| files | If this option is not set then the files added to git index will be scanned. This is useful when setting executing this tool on a git-hook pre-commit. |
9292

9393
## What features are planned for development?
94-
- Add support for Drupal and Laravel coding standards.
9594
- Add command to create new project.
9695

9796
> Note: This project is a work-in-progress and need some love related to code clean up and testing coverage.

config/drupal.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ application:
1919
phpcs:
2020
enabled: true
2121
exception: false
22-
options:
23-
standard: ~/.composer/vendor/drupal/coder/coder_sniffer/Drupal/ruleset.xml
22+
file:
23+
standard: vendor/drupal/coder/coder_sniffer/Drupal/ruleset.xml
2424
phpmd:
2525
enabled: false
2626
exception: false

src/Command/AnalyzeCommand.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ private function analyzer($output, $analyzer, $files, $config, $project)
213213
if ($configFile) {
214214
$processArguments[] = $configFile;
215215
$singleExecution = $config->get('application.analyzer.'.$analyzer.'.file.single-execution');
216+
216217
if ($singleExecution) {
217218
$process = $this->executeProcess($output, $processArguments, $arguments, $options);
218219
$success = $process->isSuccessful();

src/Config.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,11 @@ public function getProjectAnalyzerConfigFile($project, $analyzer)
9898
$analyserConfigOption = key($analyserConfig);
9999
$analyserConfigFile = current($analyserConfig);
100100

101+
$configFile = __DIR__.'/../'.$analyserConfigFile;
102+
if (file_exists($configFile)) {
103+
return '--'.$analyserConfigOption.'='.$configFile;
104+
}
105+
101106
$configFile = getcwd().'/'.$analyserConfigFile;
102107
if (file_exists($configFile)) {
103108
return '--'.$analyserConfigOption.'='.$configFile;

0 commit comments

Comments
 (0)