Skip to content
Open
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
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
"require-dev": {
"symplify/easy-coding-standard": "^12.5",
"squizlabs/php_codesniffer": "^3.12",
"squizlabs/php_codesniffer": "^4.0",
"phpunit/phpunit": "^11.5",
"phpstan/extension-installer": "^1.4",
"phpstan/phpstan": "^2.1",
Expand Down
5 changes: 5 additions & 0 deletions src/Fixer/Naming/ClassNameResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ private function resolveFromTokens(Tokens $tokens): ?string
}

$nextNextMeaningfulTokenIndex = $tokens->getNextMeaningfulToken($position + 1);

if (null === $nextNextMeaningfulTokenIndex) {
continue;
}

$nextNextMeaningfulToken = $tokens[$nextNextMeaningfulTokenIndex];

// skip anonymous classes
Expand Down
5 changes: 5 additions & 0 deletions src/Fixer/Naming/MethodNameResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ public function resolve(Tokens $tokens, int $currentPosition): ?string
}

$nextNextMeaningfulTokenIndex = $tokens->getNextMeaningfulToken($position + 1);

if (null === $nextNextMeaningfulTokenIndex) {
continue;
}

$nextNextMeaningfulToken = $tokens[$nextNextMeaningfulTokenIndex];

// skip anonymous functions
Expand Down
1 change: 1 addition & 0 deletions src/TokenRunner/Traverser/TokenReverser.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public function reverse(Tokens $tokens): array
$reversedTokens = array_reverse($tokens->toArray(), true);

// remove null values
// @phpstan-ignore arrayFilter.same
return array_filter($reversedTokens);
}
}
Loading