Skip to content

Commit

Permalink
Test one more case of "Cannot access constant on class-string"
Browse files Browse the repository at this point in the history
Ref #44
  • Loading branch information
spaze committed May 30, 2022
1 parent b81392b commit 23412f0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/Usages/ClassConstantInvalidUsagesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ public function testRule(): void
'Cannot access constant COOKIE on class-string',
14,
],
[
'Cannot access constant UTC on class-string<DateTimeZone>',
18,
],
]);
}

Expand Down
4 changes: 4 additions & 0 deletions tests/src/invalid/constantUsages.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,7 @@
/** @var class-string $monster */
$monster = DateTime::class;
$monster::COOKIE;

/** @var class-string<DateTimeZone> $tz */
$tz = DateTimeZone::class;
$tz::UTC;

0 comments on commit 23412f0

Please sign in to comment.