|
| 1 | +<?xml version="1.0"?> |
| 2 | +<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="PHPCompatibilitySymfonyPolyfillPHP83" 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.3 library.</description> |
| 5 | + |
| 6 | + <rule ref="PHPCompatibility"> |
| 7 | + <!-- https://github.com/symfony/polyfill-php83/blob/master/bootstrap.php --> |
| 8 | + <exclude name="PHPCompatibility.FunctionUse.NewFunctions.json_validateFound"/> |
| 9 | + <exclude name="PHPCompatibility.FunctionUse.NewFunctions.mb_str_padFound"/> |
| 10 | + <exclude name="PHPCompatibility.FunctionUse.NewFunctions.stream_context_set_optionsFound"/> |
| 11 | + <exclude name="PHPCompatibility.FunctionUse.NewFunctions.str_incrementFound"/> |
| 12 | + <exclude name="PHPCompatibility.FunctionUse.NewFunctions.str_decrementFound"/> |
| 13 | + <exclude name="PHPCompatibility.FunctionUse.NewFunctions.ldap_exop_syncFound"/> |
| 14 | + <exclude name="PHPCompatibility.FunctionUse.NewFunctions.ldap_connect_walletFound"/> |
| 15 | + |
| 16 | + <!-- https://github.com/symfony/polyfill-php83/tree/main/Resources/stubs --> |
| 17 | + <!-- |
| 18 | + Detection for the Override attributes is incomplete in PHPCompatibility 10.0.0-alpha1. |
| 19 | + Handling for this should be added once the detection implementation is known. |
| 20 | + --> |
| 21 | + <exclude name="PHPCompatibility.Classes.NewClasses.dateerrorFound"/> |
| 22 | + <exclude name="PHPCompatibility.Classes.NewClasses.dateexceptionFound"/> |
| 23 | + <exclude name="PHPCompatibility.Classes.NewClasses.dateinvalidoperationexceptionFound"/> |
| 24 | + <exclude name="PHPCompatibility.Classes.NewClasses.dateinvalidtimezoneexceptionFound"/> |
| 25 | + <exclude name="PHPCompatibility.Classes.NewClasses.datemalformedintervalstringexceptionFound"/> |
| 26 | + <exclude name="PHPCompatibility.Classes.NewClasses.datemalformedperiodstringexceptionFound"/> |
| 27 | + <exclude name="PHPCompatibility.Classes.NewClasses.datemalformedstringexceptionFound"/> |
| 28 | + <exclude name="PHPCompatibility.Classes.NewClasses.dateobjecterrorFound"/> |
| 29 | + <exclude name="PHPCompatibility.Classes.NewClasses.daterangeerrorFound"/> |
| 30 | + <exclude name="PHPCompatibility.Classes.NewClasses.sqlite3exceptionFound"/> |
| 31 | + </rule> |
| 32 | + |
| 33 | + <!-- Prevent false positives being thrown when run over the code of polyfill-php83 itself. --> |
| 34 | + <rule ref="PHPCompatibility.Attributes.NewAttributes.PHPNativeAttributeFound"> |
| 35 | + <exclude-pattern>/polyfill-php83/Resources/stubs/Override\.php$</exclude-pattern> |
| 36 | + </rule> |
| 37 | + <rule ref="PHPCompatibility.Classes.NewClasses.attributeFound"> |
| 38 | + <exclude-pattern>/polyfill-php83/Resources/stubs/Override\.php$</exclude-pattern> |
| 39 | + </rule> |
| 40 | + |
| 41 | + <rule ref="PHPCompatibility.FunctionUse.OptionalToRequiredFunctionParameters.stream_context_set_option_option_nameSoftRequired"> |
| 42 | + <exclude-pattern>/polyfill-php83/bootstrap\.php$</exclude-pattern> |
| 43 | + </rule> |
| 44 | + <rule ref="PHPCompatibility.FunctionUse.OptionalToRequiredFunctionParameters.stream_context_set_option_valueSoftRequired"> |
| 45 | + <exclude-pattern>/polyfill-php83/bootstrap\.php$</exclude-pattern> |
| 46 | + </rule> |
| 47 | + <rule ref="PHPCompatibility.FunctionUse.RemovedFunctionParameters.ldap_exop_response_dataDeprecated"> |
| 48 | + <exclude-pattern>/polyfill-php83/bootstrap\.php$</exclude-pattern> |
| 49 | + <exclude-pattern>/polyfill-php83/bootstrap81\.php$</exclude-pattern> |
| 50 | + </rule> |
| 51 | + <rule ref="PHPCompatibility.FunctionUse.RemovedFunctionParameters.ldap_exop_response_oidDeprecated"> |
| 52 | + <exclude-pattern>/polyfill-php83/bootstrap\.php$</exclude-pattern> |
| 53 | + <exclude-pattern>/polyfill-php83/bootstrap81\.php$</exclude-pattern> |
| 54 | + </rule> |
| 55 | + <rule ref="PHPCompatibility.ParameterValues.RemovedLdapConnectSignatures.DeprecatedThreePlusParamSignature"> |
| 56 | + <exclude-pattern>/polyfill-php83/bootstrap\.php$</exclude-pattern> |
| 57 | + <exclude-pattern>/polyfill-php83/bootstrap81\.php$</exclude-pattern> |
| 58 | + </rule> |
| 59 | + |
| 60 | + <!-- These are fine as this file will only be used for PHP 8.1 and 8.2. --> |
| 61 | + <rule ref="PHPCompatibility.Classes.NewClasses.ldap_connectionFound"> |
| 62 | + <exclude-pattern>/polyfill-php83/bootstrap81\.php$</exclude-pattern> |
| 63 | + </rule> |
| 64 | + <rule ref="PHPCompatibility.FunctionUse.NewFunctionParameters.ldap_exop_controlsFound"> |
| 65 | + <exclude-pattern>/polyfill-php83/bootstrap81\.php$</exclude-pattern> |
| 66 | + </rule> |
| 67 | + <rule ref="PHPCompatibility.FunctionDeclarations.NewReturnTypeDeclarations.UnionTypeFound"> |
| 68 | + <exclude-pattern>/polyfill-php83/bootstrap81\.php$</exclude-pattern> |
| 69 | + </rule> |
| 70 | + <rule ref="PHPCompatibility.FunctionDeclarations.NewReturnTypeDeclarations.falseFound"> |
| 71 | + <exclude-pattern>/polyfill-php83/bootstrap81\.php$</exclude-pattern> |
| 72 | + </rule> |
| 73 | + <rule ref="PHPCompatibility.Attributes.NewAttributes.PHPNativeAttributeFound"> |
| 74 | + <exclude-pattern>/polyfill-php83/bootstrap81\.php$</exclude-pattern> |
| 75 | + </rule> |
| 76 | + <rule ref="PHPCompatibility.Attributes.NewAttributes.FoundInline"> |
| 77 | + <exclude-pattern>/polyfill-php83/bootstrap81\.php$</exclude-pattern> |
| 78 | + </rule> |
| 79 | + |
| 80 | + <!-- |
| 81 | + Not a false positive, but a bug in the Symfony PHP 8.3 polyfill package. |
| 82 | + Bug has been reported: https://github.com/symfony/polyfill/issues/499#issuecomment-3430297592 |
| 83 | + Temporarily silencing the error as this needs to be solved upstream. |
| 84 | + --> |
| 85 | + <rule ref="PHPCompatibility.Classes.NewClasses.valueerrorFound"> |
| 86 | + <exclude-pattern>/polyfill-php83/Php83\.php$</exclude-pattern> |
| 87 | + </rule> |
| 88 | + |
| 89 | + <!-- |
| 90 | + Not a false positive, but a bug in the Symfony PHP 8.3 polyfill package. |
| 91 | + Bug has been reported: https://github.com/symfony/polyfill/issues/550 |
| 92 | + Temporarily silencing the error as this needs to be solved upstream. |
| 93 | + --> |
| 94 | + <rule ref="PHPCompatibility.FunctionUse.NewFunctionParameters.ldap_exop_controlsFound"> |
| 95 | + <exclude-pattern>/polyfill-php83/bootstrap\.php$</exclude-pattern> |
| 96 | + </rule> |
| 97 | + |
| 98 | +</ruleset> |
0 commit comments