Skip to content

Commit

Permalink
chore: TokensAnalyzer - string-enum for better typehinting (PHP-CS-Fi…
Browse files Browse the repository at this point in the history
  • Loading branch information
keradus authored and danog committed Feb 2, 2024
1 parent db7910f commit f62f26e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Tokenizer/TokensAnalyzer.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
* @author Gregor Harlan <gharlan@web.de>
*
* @internal
*
* @phpstan-type ClassyElementType 'case'|'const'|'method'|'property'|'trait_import'
*/
final class TokensAnalyzer
{
Expand All @@ -44,7 +46,7 @@ public function __construct(Tokens $tokens)
/**
* Get indices of methods and properties in classy code (classes, interfaces and traits).
*
* @return array<int, array{classIndex: int, token: Token, type: string}>
* @return array<int, array{classIndex: int, token: Token, type: ClassyElementType}>
*/
public function getClassyElements(): array
{
Expand Down Expand Up @@ -724,7 +726,7 @@ public function isSuperGlobal(int $index): bool
*
* @param int $classIndex classy index
*
* @return array{int, array<int, array{classIndex: int, token: Token, type: string}>}
* @return array{int, array<int, array{classIndex: int, token: Token, type: ClassyElementType}>}
*/
private function findClassyElements(int $classIndex, int $index): array
{
Expand Down

0 comments on commit f62f26e

Please sign in to comment.