Commit 27fd29a
committed
Remove some redundant code
With the `MessageCollector` being used in the `Ruleset` class since PR 857, some guard code as introduced in 99 is no longer needed.
The guard code was in place to prevent the following situation:
* File under test contained an invalid `// phpcs:set` annotation which tried to set a non-existent property on a sniff.
* The `File::process()` method would see this annotation and call the `Ruleset::setSniffProperty()` method to set the property.
* The `Ruleset::setSniffProperty()` method would throw an exception for the non-existent property.
* The exception would cause the `File` class to stop scanning the file, potentially leading to missing errors/warnings.
As the error for setting a non-existent property now no longer leads to an exception on a direct call to the `Ruleset::setSniffProperty()` method, we also no longer need to catch the exception and handle it from within the `File::process()` method.
In practice, this means that setting a non-existent property on a sniff via an inline `// phpcs:set` annotation will now be silently ignored (again) and will not affect the scan of the rest of the file.
This commit reverts 99.1 parent d0d4411 commit 27fd29a
File tree
3 files changed
+1
-26
lines changed- src
- Files
- Standards/Generic/Tests/PHP
3 files changed
+1
-26
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
346 | 346 | | |
347 | 347 | | |
348 | 348 | | |
349 | | - | |
350 | 349 | | |
351 | 350 | | |
352 | 351 | | |
| |||
415 | 414 | | |
416 | 415 | | |
417 | 416 | | |
418 | | - | |
419 | | - | |
420 | | - | |
421 | | - | |
422 | | - | |
423 | | - | |
424 | | - | |
425 | | - | |
426 | | - | |
| 417 | + | |
427 | 418 | | |
428 | 419 | | |
429 | 420 | | |
| |||
553 | 544 | | |
554 | 545 | | |
555 | 546 | | |
556 | | - | |
557 | | - | |
558 | | - | |
559 | | - | |
560 | | - | |
561 | | - | |
562 | | - | |
563 | 547 | | |
564 | 548 | | |
565 | 549 | | |
| |||
Lines changed: 0 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
Lines changed: 0 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
36 | 35 | | |
37 | 36 | | |
38 | 37 | | |
| |||
48 | 47 | | |
49 | 48 | | |
50 | 49 | | |
51 | | - | |
52 | 50 | | |
53 | 51 | | |
54 | 52 | | |
| |||
0 commit comments