|
65 | 65 | * @property string $stdinContent Content passed directly to PHPCS on STDIN.
|
66 | 66 | * @property string $stdinPath The path to use for content passed on STDIN.
|
67 | 67 | * @property bool $trackTime Whether or not to track sniff run time.
|
| 68 | + * @property bool $allowEmptyFileList Suppresses "No files were checked" error. |
68 | 69 | *
|
69 | 70 | * @property array<string, string> $extensions File extensions that should be checked, and what tokenizer is used.
|
70 | 71 | * E.g., array('inc' => 'PHP');
|
@@ -160,42 +161,43 @@ class Config
|
160 | 161 | * @var array<string, mixed>
|
161 | 162 | */
|
162 | 163 | private $settings = [
|
163 |
| - 'files' => null, |
164 |
| - 'standards' => null, |
165 |
| - 'verbosity' => null, |
166 |
| - 'interactive' => null, |
167 |
| - 'parallel' => null, |
168 |
| - 'cache' => null, |
169 |
| - 'cacheFile' => null, |
170 |
| - 'colors' => null, |
171 |
| - 'explain' => null, |
172 |
| - 'local' => null, |
173 |
| - 'showSources' => null, |
174 |
| - 'showProgress' => null, |
175 |
| - 'quiet' => null, |
176 |
| - 'annotations' => null, |
177 |
| - 'tabWidth' => null, |
178 |
| - 'encoding' => null, |
179 |
| - 'extensions' => null, |
180 |
| - 'sniffs' => null, |
181 |
| - 'exclude' => null, |
182 |
| - 'ignored' => null, |
183 |
| - 'reportFile' => null, |
184 |
| - 'generator' => null, |
185 |
| - 'filter' => null, |
186 |
| - 'bootstrap' => null, |
187 |
| - 'reports' => null, |
188 |
| - 'basepath' => null, |
189 |
| - 'reportWidth' => null, |
190 |
| - 'errorSeverity' => null, |
191 |
| - 'warningSeverity' => null, |
192 |
| - 'recordErrors' => null, |
193 |
| - 'suffix' => null, |
194 |
| - 'stdin' => null, |
195 |
| - 'stdinContent' => null, |
196 |
| - 'stdinPath' => null, |
197 |
| - 'trackTime' => null, |
198 |
| - 'unknown' => null, |
| 164 | + 'files' => null, |
| 165 | + 'standards' => null, |
| 166 | + 'verbosity' => null, |
| 167 | + 'interactive' => null, |
| 168 | + 'parallel' => null, |
| 169 | + 'cache' => null, |
| 170 | + 'cacheFile' => null, |
| 171 | + 'colors' => null, |
| 172 | + 'explain' => null, |
| 173 | + 'local' => null, |
| 174 | + 'showSources' => null, |
| 175 | + 'showProgress' => null, |
| 176 | + 'quiet' => null, |
| 177 | + 'annotations' => null, |
| 178 | + 'tabWidth' => null, |
| 179 | + 'encoding' => null, |
| 180 | + 'extensions' => null, |
| 181 | + 'sniffs' => null, |
| 182 | + 'exclude' => null, |
| 183 | + 'ignored' => null, |
| 184 | + 'reportFile' => null, |
| 185 | + 'generator' => null, |
| 186 | + 'filter' => null, |
| 187 | + 'bootstrap' => null, |
| 188 | + 'reports' => null, |
| 189 | + 'basepath' => null, |
| 190 | + 'reportWidth' => null, |
| 191 | + 'errorSeverity' => null, |
| 192 | + 'warningSeverity' => null, |
| 193 | + 'recordErrors' => null, |
| 194 | + 'suffix' => null, |
| 195 | + 'stdin' => null, |
| 196 | + 'stdinContent' => null, |
| 197 | + 'stdinPath' => null, |
| 198 | + 'trackTime' => null, |
| 199 | + 'unknown' => null, |
| 200 | + 'allowEmptyFileList' => null, |
199 | 201 | ];
|
200 | 202 |
|
201 | 203 | /**
|
@@ -581,6 +583,7 @@ public function restoreDefaults()
|
581 | 583 | $this->stdinPath = null;
|
582 | 584 | $this->trackTime = false;
|
583 | 585 | $this->unknown = [];
|
| 586 | + $this->allowEmptyFileList = false; |
584 | 587 |
|
585 | 588 | $standard = self::getConfigData('default_standard');
|
586 | 589 | if ($standard !== null) {
|
@@ -828,6 +831,14 @@ public function processLongArgument(string $arg, int $pos)
|
828 | 831 | $this->annotations = false;
|
829 | 832 | $this->overriddenDefaults['annotations'] = true;
|
830 | 833 | break;
|
| 834 | + case 'allow-empty-file-list': |
| 835 | + if (isset($this->overriddenDefaults['allowEmptyFileList']) === true) { |
| 836 | + break; |
| 837 | + } |
| 838 | + |
| 839 | + $this->allowEmptyFileList = true; |
| 840 | + $this->overriddenDefaults['allowEmptyFileList'] = true; |
| 841 | + break; |
831 | 842 | case 'config-set':
|
832 | 843 | if (isset($this->cliArgs[($pos + 1)]) === false
|
833 | 844 | || isset($this->cliArgs[($pos + 2)]) === false
|
|
0 commit comments