Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions build/more-enum-adapter-errors.neon
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
parameters:
ignoreErrors:
-
message: "#^Parameter \\#1 \\$expected of method PHPUnit\\\\Framework\\\\Assert\\:\\:assertInstanceOf\\(\\) expects class\\-string\\<ReflectionEnum\\>, string given\\.$#"
count: 1
path: ../tests/PHPStan/Reflection/ClassReflectionTest.php
-
message: "#^Strict comparison using \\!\\=\\= between class\\-string and 'UnitEnum' will always evaluate to true\\.$#"
count: 1
Expand All @@ -23,3 +19,6 @@ parameters:
message: "#^Class BackedEnum not found\\.$#"
count: 1
path: ../src/Type/Php/BackedEnumFromMethodDynamicReturnTypeExtension.php

-
message: "#^Call to method PHPStan\\\\Reflection\\\\ClassReflection::isEnum\\(\\) will always evaluate to false\\.$#"
1 change: 1 addition & 0 deletions src/Reflection/ClassReflection.php
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,7 @@ public function isTrait(): bool

/**
* @phpstan-assert-if-true ReflectionEnum $this->reflection
* @phpstan-assert-if-true ReflectionEnum $this->getNativeReflection()
*/
public function isEnum(): bool
{
Expand Down
2 changes: 1 addition & 1 deletion tests/PHPStan/Reflection/ClassReflectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ public function testEnumIsFinal(): void
$reflectionProvider = $this->createReflectionProvider();
$enum = $reflectionProvider->getClass('PHPStan\Fixture\TestEnum');
$this->assertTrue($enum->isEnum());
$this->assertInstanceOf('ReflectionEnum', $enum->getNativeReflection());
$this->assertInstanceOf('ReflectionEnum', $enum->getNativeReflection()); // @phpstan-ignore-line Exact error differs on PHP 7.4 and others
$this->assertTrue($enum->isFinal());
$this->assertTrue($enum->isFinalByKeyword());
}
Expand Down
Loading