Skip to content

Commit b5d7e9f

Browse files
committed
Backporting public method optimization
1 parent 1fa0023 commit b5d7e9f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/FieldsBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ private function getFieldsByAnnotations($controller, string $annotationName, boo
233233
}
234234
}
235235

236-
foreach ($refClass->getMethods() as $refMethod) {
236+
foreach ($refClass->getMethods(ReflectionMethod::IS_PUBLIC) as $refMethod) {
237237
if ($closestMatchingTypeClass !== null && $closestMatchingTypeClass === $refMethod->getDeclaringClass()->getName()) {
238238
// Optimisation: no need to fetch annotations from parent classes that are ALREADY GraphQL types.
239239
// We will merge the fields anyway.

src/Mappers/GlobTypeMapper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,8 +329,8 @@ private function buildMap(): void
329329

330330
$isAbstract = $refClass->isAbstract();
331331

332-
foreach ($refClass->getMethods() as $method) {
333-
if (!$method->isPublic() || ($isAbstract && !$method->isStatic())) {
332+
foreach ($refClass->getMethods(ReflectionMethod::IS_PUBLIC) as $method) {
333+
if ($isAbstract && !$method->isStatic()) {
334334
continue;
335335
}
336336
$factory = $this->annotationReader->getFactoryAnnotation($method);

0 commit comments

Comments
 (0)