Skip to content

Commit e013997

Browse files
committed
[BE] Check preg_quote delimiter sanity
1 parent 660cf2d commit e013997

File tree

5 files changed

+3
-14
lines changed

5 files changed

+3
-14
lines changed

changelog-2.0.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Major new features 🚀
1111
* [Learn more on phpstan.org](https://phpstan.org/blog/enhancements-in-handling-parameters-passed-by-reference)
1212
* [#2941](https://github.com/phpstan/phpstan-src/pull/2941), thanks @ljmaskey!
1313
* LogicalXorConstantConditionRule (level 4) (https://github.com/phpstan/phpstan-src/commit/3a12724fd636b1bcf36c22b36e8f765d97150895, https://github.com/phpstan/phpstan-src/commit/3b011f6524254dad0f16840fdcfdbe7421548617), #7539
14+
* Check preg_quote delimiter sanity (level 0) ([#3252](https://github.com/phpstan/phpstan-src/pull/3252)), #11338, thanks @staabm!
1415
* Added previously absent type checks (level 0)
1516
* Check existing classes in `@phpstan-self-out` (https://github.com/phpstan/phpstan-src/commit/6838669976bf20232abde36ecdd52b1770fa50c9)
1617
* Check nonexistent classes in local type aliases (https://github.com/phpstan/phpstan-src/commit/2485b2e9c129e789ec3b2d7db81ca30f87c63911)
@@ -87,10 +88,8 @@ Bleeding edge (TODO move to other sections)
8788
* Enforce `@no-named-arguments` (https://github.com/phpstan/phpstan-src/commit/74ba8c23696948f2647d880df72f375346f41010), #5968
8889
* Check too wide private property type (https://github.com/phpstan/phpstan-src/commit/7453f4f75fae3d635063589467842aae29d88b54)
8990
* Check `@param-immediately-invoked-callable` and `@param-later-invoked-callable` (https://github.com/phpstan/phpstan-src/commit/580a6add422f4e34191df9e7a77ba1655e914bda), #10932
90-
* RegularExpressionPatternRule: validate preg_quote'd patterns ([#3270](https://github.com/phpstan/phpstan-src/pull/3270)), thanks @staabm!
9191
* Report useless return values of function calls like `var_export` without `$return=true` ([#3225](https://github.com/phpstan/phpstan-src/pull/3225)), #11320, thanks @staabm!
9292
* Check vprintf/vsprintf arguments against placeholder count ([#3126](https://github.com/phpstan/phpstan-src/pull/3126)), thanks @staabm!
93-
* Check preg_quote delimiter sanity ([#3252](https://github.com/phpstan/phpstan-src/pull/3252)), #11338, thanks @staabm!
9493
* Check array functions which require stringish values ([#3132](https://github.com/phpstan/phpstan-src/pull/3132)), #11141, #5848, #3694, #11111, thanks @schlndh!
9594

9695
Improvements 🔧

conf/bleedingEdge.neon

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,5 @@ parameters:
3737
checkParameterCastableToStringFunctions: true
3838
uselessReturnValue: true
3939
printfArrayParameters: true
40-
validatePregQuote: true
4140
tooWidePropertyType: true
4241
requireFileExists: true

conf/config.level0.neon

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ conditionalTags:
2828
phpstan.rules.rule: %featureToggles.uselessReturnValue%
2929
PHPStan\Rules\Functions\PrintfArrayParametersRule:
3030
phpstan.rules.rule: %featureToggles.printfArrayParameters%
31-
PHPStan\Rules\Regexp\RegularExpressionQuotingRule:
32-
phpstan.rules.rule: %featureToggles.validatePregQuote%
3331
PHPStan\Rules\Keywords\RequireFileExistsRule:
3432
phpstan.rules.rule: %featureToggles.requireFileExists%
3533

@@ -114,6 +112,8 @@ rules:
114112
- PHPStan\Rules\Properties\PropertiesInInterfaceRule
115113
- PHPStan\Rules\Properties\PropertyAttributesRule
116114
- PHPStan\Rules\Properties\ReadOnlyPropertyRule
115+
- PHPStan\Rules\Regexp\RegularExpressionPatternRule
116+
- PHPStan\Rules\Regexp\RegularExpressionQuotingRule
117117
- PHPStan\Rules\Traits\ConflictingTraitConstantsRule
118118
- PHPStan\Rules\Traits\ConstantsInTraitsRule
119119
- PHPStan\Rules\Types\InvalidTypesInUnionRule
@@ -279,11 +279,6 @@ services:
279279
tags:
280280
- phpstan.rules.rule
281281

282-
-
283-
class: PHPStan\Rules\Regexp\RegularExpressionPatternRule
284-
tags:
285-
- phpstan.rules.rule
286-
287282
-
288283
class: PHPStan\Reflection\ConstructorsHelper
289284
arguments:
@@ -301,8 +296,6 @@ services:
301296
-
302297
class: PHPStan\Rules\Functions\PrintfArrayParametersRule
303298

304-
-
305-
class: PHPStan\Rules\Regexp\RegularExpressionQuotingRule
306299
-
307300
class: PHPStan\Rules\Keywords\RequireFileExistsRule
308301
arguments:

conf/config.neon

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ parameters:
5959
checkParameterCastableToStringFunctions: false
6060
uselessReturnValue: false
6161
printfArrayParameters: false
62-
validatePregQuote: false
6362
requireFileExists: false
6463
narrowPregMatches: true
6564
tooWidePropertyType: false

conf/parametersSchema.neon

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ parametersSchema:
6565
checkParameterCastableToStringFunctions: bool()
6666
uselessReturnValue: bool()
6767
printfArrayParameters: bool()
68-
validatePregQuote: bool()
6968
narrowPregMatches: bool()
7069
tooWidePropertyType: bool()
7170
requireFileExists: bool()

0 commit comments

Comments
 (0)