You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
'@readonly property cannot have a default value.' => 10,
16
+
'@readonly property test\PhpStaticAnalysis\PHPStanExtension\data\Immutable\ClassImmutableAttribute::$name is assigned outside of its declaring class.' => 14,
'PHPDoc tag @phpstan-import-type has invalid value (Unexpected token "(", expected \'*/\' at offset 98 on line 4): Unexpected token "(", expected \'*/\' at offset 98' => 8,
31
-
'Parameter #1 ...$from of attribute class PhpStaticAnalysis\Attributes\ImportType constructor expects string, int given.' => 8,
32
-
'Attribute class PhpStaticAnalysis\Attributes\ImportType does not have the method target.' => 13,
33
-
];
29
+
if (self::getPhpStanVersion() < '2') {
30
+
$expectedErrors = [
31
+
'PHPDoc tag @phpstan-import-type has invalid value (Unexpected token "(", expected \'*/\' at offset 98 on line 4): Unexpected token "(", expected \'*/\' at offset 98' => 8,
32
+
'Parameter #1 ...$from of attribute class PhpStaticAnalysis\Attributes\ImportType constructor expects string, int given.' => 8,
33
+
'Attribute class PhpStaticAnalysis\Attributes\ImportType does not have the method target.' => 13,
34
+
];
35
+
} else {
36
+
$expectedErrors = [
37
+
'Parameter #1 ...$from of attribute class PhpStaticAnalysis\Attributes\ImportType constructor expects string, int given.' => 8,
38
+
'PHPDoc tag @phpstan-import-type has invalid value (Unexpected token "(", expected \'*/\' at offset 98 on line 4): Unexpected token "(", expected \'*/\' at offset 98 on line 4' => 11,
39
+
'Attribute class PhpStaticAnalysis\Attributes\ImportType does not have the method target.' => 13,
'Attribute class PhpStaticAnalysis\Attributes\Impure does not have the property target.' => 11,
25
-
'Attribute class PhpStaticAnalysis\Attributes\Impure is not repeatable but is already present above the method.' => 15,
26
-
];
23
+
if (self::getPhpStanVersion() < '2') {
24
+
$expectedErrors = [
25
+
'Attribute class PhpStaticAnalysis\Attributes\Impure does not have the property target.' => 11,
26
+
'Attribute class PhpStaticAnalysis\Attributes\Impure is not repeatable but is already present above the method.' => 15,
27
+
];
28
+
} else {
29
+
$expectedErrors = [
30
+
'Attribute class PhpStaticAnalysis\Attributes\Impure does not have the property target.' => 11,
31
+
'Method test\PhpStaticAnalysis\PHPStanExtension\data\Impure\InvalidMethodImpureAttribute::getMoreName() is marked as impure but does not have any side effects.' => 14,
32
+
'Attribute class PhpStaticAnalysis\Attributes\Impure is not repeatable but is already present above the method.' => 15,
'Class test\PhpStaticAnalysis\PHPStanExtension\data\TemplateExtends\InvalidClassTemplateExtendsAttributeChild extends generic class test\PhpStaticAnalysis\PHPStanExtension\data\TemplateExtends\InvalidClassTemplateExtendsAttribute but does not specify its types: T' => 13,
19
-
'PHPDoc tag @template-extends has invalid value (): Unexpected token "\n ", expected type at offset 24' => 13,
20
-
'Parameter #1 $class of attribute class PhpStaticAnalysis\Attributes\TemplateExtends constructor expects string, int given.' => 13,
21
-
'Class test\PhpStaticAnalysis\PHPStanExtension\data\TemplateExtends\InvalidClassTemplateExtendsAttributeChild2 extends generic class test\PhpStaticAnalysis\PHPStanExtension\data\TemplateExtends\InvalidClassTemplateExtendsAttribute but does not specify its types: T' => 18,
22
-
'PHPDoc tag @template-extends has invalid value (+5): Unexpected token "+5", expected type at offset 25' => 18,
23
-
'Attribute class PhpStaticAnalysis\Attributes\TemplateExtends is not repeatable but is already present above the class.' => 24,
24
-
'Attribute class PhpStaticAnalysis\Attributes\TemplateExtends does not have the property target.' => 27,
25
-
];
17
+
if (self::getPhpStanVersion() < '2') {
18
+
$expectedErrors = [
19
+
'Class test\PhpStaticAnalysis\PHPStanExtension\data\TemplateExtends\InvalidClassTemplateExtendsAttributeChild extends generic class test\PhpStaticAnalysis\PHPStanExtension\data\TemplateExtends\InvalidClassTemplateExtendsAttribute but does not specify its types: T' => 13,
20
+
'PHPDoc tag @template-extends has invalid value (): Unexpected token "\n ", expected type at offset 24' => 13,
21
+
'Parameter #1 $class of attribute class PhpStaticAnalysis\Attributes\TemplateExtends constructor expects string, int given.' => 13,
22
+
'Class test\PhpStaticAnalysis\PHPStanExtension\data\TemplateExtends\InvalidClassTemplateExtendsAttributeChild2 extends generic class test\PhpStaticAnalysis\PHPStanExtension\data\TemplateExtends\InvalidClassTemplateExtendsAttribute but does not specify its types: T' => 18,
23
+
'PHPDoc tag @template-extends has invalid value (+5): Unexpected token "+5", expected type at offset 25' => 18,
24
+
'Attribute class PhpStaticAnalysis\Attributes\TemplateExtends is not repeatable but is already present above the class.' => 24,
25
+
'Attribute class PhpStaticAnalysis\Attributes\TemplateExtends does not have the property target.' => 27,
26
+
];
27
+
} else {
28
+
$expectedErrors = [
29
+
'Class test\PhpStaticAnalysis\PHPStanExtension\data\TemplateExtends\InvalidClassTemplateExtendsAttributeChild extends generic class test\PhpStaticAnalysis\PHPStanExtension\data\TemplateExtends\InvalidClassTemplateExtendsAttribute but does not specify its types: T' => 13,
30
+
'Parameter #1 $class of attribute class PhpStaticAnalysis\Attributes\TemplateExtends constructor expects string, int given.' => 13,
31
+
'PHPDoc tag @template-extends has invalid value (): Unexpected token "\n ", expected type at offset 24 on line 2' => 14,
32
+
'Class test\PhpStaticAnalysis\PHPStanExtension\data\TemplateExtends\InvalidClassTemplateExtendsAttributeChild2 extends generic class test\PhpStaticAnalysis\PHPStanExtension\data\TemplateExtends\InvalidClassTemplateExtendsAttribute but does not specify its types: T' => 18,
33
+
'PHPDoc tag @template-extends has invalid value (+5): Unexpected token "+5", expected type at offset 25 on line 2' => 19,
34
+
'Attribute class PhpStaticAnalysis\Attributes\TemplateExtends is not repeatable but is already present above the class.' => 24,
35
+
'Attribute class PhpStaticAnalysis\Attributes\TemplateExtends does not have the property target.' => 27,
'Class test\PhpStaticAnalysis\PHPStanExtension\data\TemplateImplements\InvalidClassTemplateImplementsAttribute implements generic interface test\PhpStaticAnalysis\PHPStanExtension\data\TemplateImplements\InvalidInterfaceTemplateImplementsAttribute but does not specify its types: T' => 13,
19
-
'PHPDoc tag @template-implements has invalid value (): Unexpected token "\n ", expected type at offset 27' => 13,
20
-
'Parameter #1 ...$interfaces of attribute class PhpStaticAnalysis\Attributes\TemplateImplements constructor expects string, int given.' => 13,
21
-
'Class test\PhpStaticAnalysis\PHPStanExtension\data\TemplateImplements\InvalidClassTemplateImplementsAttribute2 implements generic interface test\PhpStaticAnalysis\PHPStanExtension\data\TemplateImplements\InvalidInterfaceTemplateImplementsAttribute but does not specify its types: T' => 18,
22
-
'PHPDoc tag @template-implements has invalid value (+5): Unexpected token "+5", expected type at offset 28' => 18,
23
-
'Attribute class PhpStaticAnalysis\Attributes\TemplateImplements does not have the property target.' => 21,
24
-
];
17
+
if (self::getPhpStanVersion() < '2') {
18
+
$expectedErrors = [
19
+
'Class test\PhpStaticAnalysis\PHPStanExtension\data\TemplateImplements\InvalidClassTemplateImplementsAttribute implements generic interface test\PhpStaticAnalysis\PHPStanExtension\data\TemplateImplements\InvalidInterfaceTemplateImplementsAttribute but does not specify its types: T' => 13,
20
+
'PHPDoc tag @template-implements has invalid value (): Unexpected token "\n ", expected type at offset 27' => 13,
21
+
'Parameter #1 ...$interfaces of attribute class PhpStaticAnalysis\Attributes\TemplateImplements constructor expects string, int given.' => 13,
22
+
'Class test\PhpStaticAnalysis\PHPStanExtension\data\TemplateImplements\InvalidClassTemplateImplementsAttribute2 implements generic interface test\PhpStaticAnalysis\PHPStanExtension\data\TemplateImplements\InvalidInterfaceTemplateImplementsAttribute but does not specify its types: T' => 18,
23
+
'PHPDoc tag @template-implements has invalid value (+5): Unexpected token "+5", expected type at offset 28' => 18,
24
+
'Attribute class PhpStaticAnalysis\Attributes\TemplateImplements does not have the property target.' => 21,
25
+
];
26
+
} else {
27
+
$expectedErrors = [
28
+
'Class test\PhpStaticAnalysis\PHPStanExtension\data\TemplateImplements\InvalidClassTemplateImplementsAttribute implements generic interface test\PhpStaticAnalysis\PHPStanExtension\data\TemplateImplements\InvalidInterfaceTemplateImplementsAttribute but does not specify its types: T' => 13,
29
+
'Parameter #1 ...$interfaces of attribute class PhpStaticAnalysis\Attributes\TemplateImplements constructor expects string, int given.' => 13,
30
+
'PHPDoc tag @template-implements has invalid value (): Unexpected token "\n ", expected type at offset 27 on line 2' => 14,
31
+
'Class test\PhpStaticAnalysis\PHPStanExtension\data\TemplateImplements\InvalidClassTemplateImplementsAttribute2 implements generic interface test\PhpStaticAnalysis\PHPStanExtension\data\TemplateImplements\InvalidInterfaceTemplateImplementsAttribute but does not specify its types: T' => 18,
32
+
'PHPDoc tag @template-implements has invalid value (+5): Unexpected token "+5", expected type at offset 28 on line 2' => 19,
33
+
'Attribute class PhpStaticAnalysis\Attributes\TemplateImplements does not have the property target.' => 21,
'PHPDoc tag @throws has invalid value (): Unexpected token "\n ", expected type at offset 14' => 10,
29
-
'Parameter #1 ...$exceptions of attribute class PhpStaticAnalysis\Attributes\Throws constructor expects string, int given.' => 10,
30
-
'Method test\PhpStaticAnalysis\PHPStanExtension\data\Throws\InvalidMethodThrowsAttribute::getOtherNameLength() has string in PHPDoc @throws tag but it\'s not thrown.' => 16,
31
-
'PHPDoc tag @throws with type string is not subtype of Throwable' => 16,
32
-
'Attribute class PhpStaticAnalysis\Attributes\Throws does not have the property target.' => 22,
33
-
];
27
+
if (self::getPhpStanVersion() < '2') {
28
+
$expectedErrors = [
29
+
'PHPDoc tag @throws has invalid value (): Unexpected token "\n ", expected type at offset 14' => 10,
30
+
'Parameter #1 ...$exceptions of attribute class PhpStaticAnalysis\Attributes\Throws constructor expects string, int given.' => 10,
31
+
'Method test\PhpStaticAnalysis\PHPStanExtension\data\Throws\InvalidMethodThrowsAttribute::getOtherNameLength() has string in PHPDoc @throws tag but it\'s not thrown.' => 16,
32
+
'PHPDoc tag @throws with type string is not subtype of Throwable' => 16,
33
+
'Attribute class PhpStaticAnalysis\Attributes\Throws does not have the property target.' => 22,
34
+
];
35
+
} else {
36
+
$expectedErrors = [
37
+
'Parameter #1 ...$exceptions of attribute class PhpStaticAnalysis\Attributes\Throws constructor expects string, int given.' => 10,
38
+
'PHPDoc tag @throws has invalid value (): Unexpected token "\n ", expected type at offset 14 on line 2' => 11,
39
+
'Method test\PhpStaticAnalysis\PHPStanExtension\data\Throws\InvalidMethodThrowsAttribute::getOtherNameLength() has string in PHPDoc @throws tag but it\'s not thrown.' => 16,
40
+
'PHPDoc tag @throws with type string is not subtype of Throwable' => 16,
41
+
'Attribute class PhpStaticAnalysis\Attributes\Throws does not have the property target.' => 22,
0 commit comments