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
Ruleset::setSniffProperty(): add BC-layer for old format property values
This commit adds a BC layer to handle property values passed to `Ruleset::setSniffProperty()` in the old (mixed) format.
This BC-layer will never be hit when PHPCS is used from the CLI/with a ruleset. This BC-layer is only in place for integrations with PHPCS which may call the `Ruleset::setSniffProperty()` method directly.
The `Ruleset::setSniffProperty()` will still handle properties passed in the old format correctly, but will also throw a deprecation notice to allow the maintainers of the integration to update their code.
Includes dedicated tests to ensure this BC-layer works as intended.
Note: this commit should **NOT** be ported to PHPCS 4.x.
__FUNCTION__.': the format of the $settings parameter has changed from (mixed) $value to array(\'scope\' => \'sniff|standard\', \'value\' => $value). Please update your integration code. See PR #3629 for more information.',
1346
+
E_USER_DEPRECATED
1347
+
);
1348
+
}
1349
+
1322
1350
$isSettable = false;
1323
1351
$sniffObject = $this->sniffs[$sniffClass];
1324
1352
if (property_exists($sniffObject, $propertyName) === true
$exceptionMsg = 'the format of the $settings parameter has changed from (mixed) $value to array(\'scope\' => \'sniff|standard\', \'value\' => $value). Please update your integration code. See PR #3629 for more information.';
384
+
385
+
if (method_exists($this, 'expectException') === true) {
0 commit comments