|
1 | 1 | <?php
|
2 | 2 |
|
| 3 | +declare(strict_types=1); |
| 4 | + |
3 | 5 | use Phpcq\PluginApi\Version10\Configuration\PluginConfigurationBuilderInterface;
|
4 | 6 | use Phpcq\PluginApi\Version10\Configuration\PluginConfigurationInterface;
|
5 | 7 | use Phpcq\PluginApi\Version10\DiagnosticsPluginInterface;
|
@@ -43,6 +45,16 @@ public function describeConfiguration(PluginConfigurationBuilderInterface $confi
|
43 | 45 | )
|
44 | 46 | ->isRequired()
|
45 | 47 | ->withDefaultValue(false);
|
| 48 | + $configOptionsBuilder |
| 49 | + ->describeStringListOption( |
| 50 | + 'excluded', |
| 51 | + 'List of excluded paths.' |
| 52 | + ); |
| 53 | + $configOptionsBuilder |
| 54 | + ->describeStringListOption( |
| 55 | + 'excluded_sniffs', |
| 56 | + 'List of excluded sniffs.' |
| 57 | + ); |
46 | 58 | }
|
47 | 59 |
|
48 | 60 | public function createDiagnosticTasks(
|
@@ -82,8 +94,16 @@ private function buildArguments(
|
82 | 94 | $arguments[] = '--standard=' . $config->getString('standard');
|
83 | 95 | }
|
84 | 96 |
|
85 |
| - if ([] !== ($excluded = $config->getStringList('excluded'))) { |
86 |
| - $arguments[] = '--exclude=' . implode(',', $excluded); |
| 97 | + if ($config->has('excluded')) { |
| 98 | + if ([] !== ($excluded = $config->getStringList('excluded'))) { |
| 99 | + $arguments[] = '--ignore=' . implode(',', $excluded); |
| 100 | + } |
| 101 | + } |
| 102 | + |
| 103 | + if ($config->has('excluded_sniffs')) { |
| 104 | + if ([] !== ($excluded = $config->getStringList('excluded_sniffs'))) { |
| 105 | + $arguments[] = '--exclude=' . implode(',', $excluded); |
| 106 | + } |
87 | 107 | }
|
88 | 108 |
|
89 | 109 | if ($config->has('custom_flags')) {
|
|
0 commit comments