Skip to content

Commit a2359a3

Browse files
committed
Apply same fix to countBy reflection
1 parent d406052 commit a2359a3

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/Reflection/RepositoryCountByMethodsClassReflectionExtension.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ public function hasMethod(ClassReflection $classReflection, string $methodName):
3232
return false;
3333
}
3434

35+
if ($classReflection->isAbstract()) {
36+
return false;
37+
}
38+
3539
if (strpos($methodName, 'countBy') !== 0) {
3640
return false;
3741
}

tests/Unit/Type/data/repository-stub-files.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ public function myTests(): void
6969
'*ERROR*',
7070
$this->findByNonexisting('a')
7171
);
72+
assertType(
73+
'*ERROR*',
74+
$this->countByNonexisting('a')
75+
);
7276
}
7377

7478
}
@@ -95,6 +99,10 @@ public function myTests(): void
9599
'*ERROR*',
96100
$this->findByNonexisting('a')
97101
);
102+
assertType(
103+
'*ERROR*',
104+
$this->countByNonexisting('a')
105+
);
98106
}
99107

100108
}

0 commit comments

Comments
 (0)