Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit bbbe15f

Browse files
committedMar 6, 2025·
fixup! Replace error-prone instanceof in Rules classes
1 parent 8e16e33 commit bbbe15f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎src/Rules/Variables/CompactVariablesRule.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,11 @@ public function processNode(Node $node, Scope $scope): array
7070
*/
7171
private function findConstantStrings(Type $type): array
7272
{
73-
if (count($type->getConstantStrings()) > 0) {
73+
if (count($type->getConstantStrings()) === 1) {
7474
return $type->getConstantStrings();
7575
}
7676

77-
if (count($type->getConstantArrays()) > 1) {
77+
if (count($type->getConstantArrays()) === 1) {
7878
$result = [];
7979
foreach ($type->getConstantArrays()[0]->getValueTypes() as $valueType) {
8080
$constantStrings = $this->findConstantStrings($valueType);

0 commit comments

Comments
 (0)
Please sign in to comment.