Skip to content

Commit d5401f9

Browse files
committed
Remove visibility filter
The visibility shouldn't matter to the collector. Attributes on non-public methods are no longer discarded.
1 parent 8292473 commit d5401f9

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Plugin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ private static function collectAttributes(array $classMap, IOInterface $io): Col
177177
$collector->addTargetClass($attribute, $classReflection);
178178
}
179179

180-
foreach ($classReflection->getMethods(ReflectionMethod::IS_PUBLIC) as $methodReflection) {
180+
foreach ($classReflection->getMethods() as $methodReflection) {
181181
foreach ($methodReflection->getAttributes() as $attribute) {
182182
if (self::isAttributeIgnored($attribute)) {
183183
continue;

tests/Acme/ClassMap/controllers.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414
final class ImageController
1515
{
1616
#[Route("/images")]
17-
public function list(): void
17+
protected function list(): void
1818
{
1919
}
2020

2121
#[Route("/images/{id}")]
22-
public function show(int $id): void
22+
private function show(int $id): void
2323
{
2424
}
2525
}

0 commit comments

Comments
 (0)