|
| 1 | +<?xml version="1.0"?> |
| 2 | +<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="PHPCompatibilitySymfonyPolyfillPHP84" xsi:noNamespaceSchemaLocation="https://schema.phpcodesniffer.com/phpcs.xsd"> |
| 3 | + |
| 4 | + <description>PHPCompatibility ruleset for PHP_CodeSniffer which accounts for polyfills provided by the Symfony PHP 8.4 library.</description> |
| 5 | + |
| 6 | + <rule ref="PHPCompatibility"> |
| 7 | + <!-- https://github.com/symfony/polyfill-php84/blob/master/bootstrap.php --> |
| 8 | + <exclude name="PHPCompatibility.Constants.NewConstants.curl_http_version_3Found"/> |
| 9 | + <exclude name="PHPCompatibility.Constants.NewConstants.curl_http_version_3onlyFound"/> |
| 10 | + <exclude name="PHPCompatibility.FunctionUse.NewFunctions.array_findFound"/> |
| 11 | + <exclude name="PHPCompatibility.FunctionUse.NewFunctions.array_find_keyFound"/> |
| 12 | + <exclude name="PHPCompatibility.FunctionUse.NewFunctions.array_anyFound"/> |
| 13 | + <exclude name="PHPCompatibility.FunctionUse.NewFunctions.array_allFound"/> |
| 14 | + <exclude name="PHPCompatibility.FunctionUse.NewFunctions.fpowFound"/> |
| 15 | + <exclude name="PHPCompatibility.FunctionUse.NewFunctions.mb_ucfirstFound"/> |
| 16 | + <exclude name="PHPCompatibility.FunctionUse.NewFunctions.mb_lcfirstFound"/> |
| 17 | + <exclude name="PHPCompatibility.FunctionUse.NewFunctions.mb_trimFound"/> |
| 18 | + <exclude name="PHPCompatibility.FunctionUse.NewFunctions.mb_ltrimFound"/> |
| 19 | + <exclude name="PHPCompatibility.FunctionUse.NewFunctions.mb_rtrimFound"/> |
| 20 | + <exclude name="PHPCompatibility.FunctionUse.NewFunctions.bcdivmodFound"/> |
| 21 | + <exclude name="PHPCompatibility.FunctionUse.NewFunctions.grapheme_str_splitFound"/> |
| 22 | + |
| 23 | + <!-- https://github.com/symfony/polyfill-php84/tree/main/Resources/stubs --> |
| 24 | + <!-- |
| 25 | + Detection for the Deprecated attribute is incomplete in PHPCompatibility 10.0.0-alpha1. |
| 26 | + Handling for this should be added once the detection implementation is known. |
| 27 | + The following exclude is a temporary placeholder, which should be removed as soon as |
| 28 | + possible as it will ignore too much. |
| 29 | + --> |
| 30 | + <exclude name="PHPCompatibility.Attributes.NewAttributes.PHPStormAttributeFound"/> |
| 31 | + |
| 32 | + <exclude name="PHPCompatibility.Classes.NewClasses.reflectionconstantFound"/> |
| 33 | + </rule> |
| 34 | + |
| 35 | + <!-- Prevent false positives being thrown when run over the code of polyfill-php83 itself. --> |
| 36 | + <rule ref="PHPCompatibility.FunctionUse.RequiredToOptionalFunctionParameters.bcscale_scaleMissing"> |
| 37 | + <exclude-pattern>/polyfill-php84/Php84\.php$</exclude-pattern> |
| 38 | + </rule> |
| 39 | + <rule ref="PHPCompatibility.Attributes.NewAttributes.PHPNativeAttributeFound"> |
| 40 | + <exclude-pattern>/polyfill-php84/Resources/stubs/Deprecated\.php$</exclude-pattern> |
| 41 | + </rule> |
| 42 | + <rule ref="PHPCompatibility.Classes.NewClasses.attributeFound"> |
| 43 | + <exclude-pattern>/polyfill-php84/Resources/stubs/Deprecated\.php$</exclude-pattern> |
| 44 | + </rule> |
| 45 | + <rule ref="PHPCompatibility.FunctionUse.NewFunctions.get_debug_typeFound"> |
| 46 | + <exclude-pattern>/polyfill-php84/Resources/stubs/ReflectionConstant\.php$</exclude-pattern> |
| 47 | + </rule> |
| 48 | + |
| 49 | + <!-- This is fine as the autoloading for this file should only ever be triggered when on PHP 8.0 or higher. --> |
| 50 | + <rule ref="PHPCompatibility.Classes.NewTypedProperties.Found"> |
| 51 | + <exclude-pattern>/polyfill-php84/Resources/stubs/Deprecated\.php$</exclude-pattern> |
| 52 | + </rule> |
| 53 | + |
| 54 | + <!-- These are fine as this file will only be used for PHP 8.2 and 8.3. --> |
| 55 | + <rule ref="PHPCompatibility.FunctionDeclarations.NewReturnTypeDeclarations.UnionTypeFound"> |
| 56 | + <exclude-pattern>/polyfill-php84/bootstrap82\.php$</exclude-pattern> |
| 57 | + </rule> |
| 58 | + <rule ref="PHPCompatibility.FunctionDeclarations.NewReturnTypeDeclarations.falseFound"> |
| 59 | + <exclude-pattern>/polyfill-php84/bootstrap82\.php$</exclude-pattern> |
| 60 | + </rule> |
| 61 | + |
| 62 | + <!-- |
| 63 | + Not a false positive, but a bug in the Symfony PHP 8.4 polyfill package. |
| 64 | + Bug has been reported: https://github.com/symfony/polyfill/issues/499#issuecomment-3430423298 |
| 65 | + Temporarily silencing the error as this needs to be solved upstream. |
| 66 | + --> |
| 67 | + <rule ref="PHPCompatibility.Classes.NewClasses.valueerrorFound"> |
| 68 | + <exclude-pattern>/polyfill-php84/Php84\.php$</exclude-pattern> |
| 69 | + </rule> |
| 70 | + |
| 71 | + <!-- |
| 72 | + Not a false positive, but a bug in the Symfony PHP 8.4 polyfill package. |
| 73 | + Bug has been reported: https://github.com/symfony/polyfill/issues/551 |
| 74 | + Temporarily silencing the error as this needs to be solved upstream. |
| 75 | + --> |
| 76 | + <rule ref="PHPCompatibility.Classes.NewReadonlyProperties.Found"> |
| 77 | + <exclude-pattern>/polyfill-php84/Resources/stubs/Deprecated\.php$</exclude-pattern> |
| 78 | + </rule> |
| 79 | + |
| 80 | +</ruleset> |
0 commit comments