Skip to content

Commit af487e4

Browse files
phpstan-botclaude
andcommitted
Use isInteger() instead of isSuperTypeOf(new IntegerType())
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent af75915 commit af487e4

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

src/Type/Php/DateIntervalFormatReturnTypeHelper.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
use PHPStan\Type\Accessory\AccessoryNonFalsyStringType;
1212
use PHPStan\Type\Accessory\AccessoryNumericStringType;
1313
use PHPStan\Type\Accessory\AccessoryUppercaseStringType;
14-
use PHPStan\Type\IntegerType;
1514
use PHPStan\Type\IntersectionType;
1615
use PHPStan\Type\StringType;
1716
use PHPStan\Type\Type;
@@ -37,7 +36,7 @@ public function getType(Type $formatType, Type $intervalType, Scope $scope): ?Ty
3736
}
3837

3938
$daysIsInt = $intervalType->hasInstanceProperty('days')->yes()
40-
&& (new IntegerType())->isSuperTypeOf($intervalType->getInstanceProperty('days', $scope)->getReadableType())->yes();
39+
&& $intervalType->getInstanceProperty('days', $scope)->getReadableType()->isInteger()->yes();
4140

4241
$dateInterval = $daysIsInt
4342
? (new DateTime('2000-01-01'))->diff(new DateTime('2000-01-01'))

0 commit comments

Comments
 (0)