Skip to content

Commit a71fa23

Browse files
phpstan-botclaude
authored andcommitted
Make DateIntervalInstantiationRule bleeding edge only
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 3b63a9c commit a71fa23

5 files changed

Lines changed: 7 additions & 2 deletions

File tree

conf/bleedingEdge.neon

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ parameters:
1616
reportNestedTooWideType: false # tmp
1717
assignToByRefForeachExpr: true
1818
curlSetOptArrayTypes: true
19+
checkDateIntervalConstructor: true

conf/config.level5.neon

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ conditionalTags:
1010
phpstan.rules.rule: %featureToggles.checkParameterCastableToNumberFunctions%
1111
PHPStan\Rules\Functions\PrintfParameterTypeRule:
1212
phpstan.rules.rule: %featureToggles.checkPrintfParameterTypes%
13+
PHPStan\Rules\DateIntervalInstantiationRule:
14+
phpstan.rules.rule: %featureToggles.checkDateIntervalConstructor%
1315

1416
autowiredAttributeServices:
1517
# registers rules with #[RegisteredRule] attribute
@@ -22,3 +24,5 @@ services:
2224
class: PHPStan\Rules\Functions\PrintfParameterTypeRule
2325
arguments:
2426
checkStrictPrintfPlaceholderTypes: %checkStrictPrintfPlaceholderTypes%
27+
-
28+
class: PHPStan\Rules\DateIntervalInstantiationRule

conf/config.neon

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ parameters:
4343
reportNestedTooWideType: false
4444
assignToByRefForeachExpr: false
4545
curlSetOptArrayTypes: false
46+
checkDateIntervalConstructor: false
4647
fileExtensions:
4748
- php
4849
checkAdvancedIsset: false

conf/parametersSchema.neon

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ parametersSchema:
4545
reportNestedTooWideType: bool()
4646
assignToByRefForeachExpr: bool()
4747
curlSetOptArrayTypes: bool()
48+
checkDateIntervalConstructor: bool()
4849
])
4950
fileExtensions: listOf(string())
5051
checkAdvancedIsset: bool()

src/Rules/DateIntervalInstantiationRule.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
use PhpParser\Node;
77
use PhpParser\Node\Expr\New_;
88
use PHPStan\Analyser\Scope;
9-
use PHPStan\DependencyInjection\RegisteredRule;
109
use Throwable;
1110
use function count;
1211
use function sprintf;
@@ -15,7 +14,6 @@
1514
/**
1615
* @implements Rule<Node\Expr\New_>
1716
*/
18-
#[RegisteredRule(level: 5)]
1917
final class DateIntervalInstantiationRule implements Rule
2018
{
2119

0 commit comments

Comments
 (0)