Skip to content

Commit d9fc04e

Browse files
committed
Ignore the PhpVersion injection in IntdivFunctionReturnTypeExtension in the config
PHP 7.4 reads the class attribute as a comment, so the class starts a line later there and the inline ignore above the attribute matched nothing. Amp-Thread-ID: https://ampcode.com/threads/T-01a1a1e7-5e72-7235-a4b2-ba1b689f7e1b
1 parent f485830 commit d9fc04e

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

‎build/phpstan.neon‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,12 @@ parameters:
135135
count: 1
136136
path: ../src/Diagnose/PHPStanDiagnoseExtension.php
137137
- identifier: ternary.shortNotAllowed
138+
-
139+
# operators take the configured PHP version, like InitializerExprTypeResolver does;
140+
# not ignored inline because PHP 7.4 reads the class attribute as a comment,
141+
# so the error is on a different line there
142+
identifier: phpstan.phpVersionInjection
143+
path: ../src/Type/Php/IntdivFunctionReturnTypeExtension.php
138144
-
139145
identifier: shipmonk.deadMethod
140146
path: ../src/Internal/CombinationsHelper.php

‎src/Type/Php/IntdivFunctionReturnTypeExtension.php‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
use PHPStan\Type\Type;
1313
use function count;
1414

15-
// operators take the configured PHP version, like InitializerExprTypeResolver does
16-
// @phpstan-ignore phpstan.phpVersionInjection
1715
#[AutowiredService]
1816
final class IntdivFunctionReturnTypeExtension implements DynamicFunctionReturnTypeExtension
1917
{

0 commit comments

Comments
 (0)