You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
0 commit comments