diff --git a/src/core/Sitemap/SitemapBuilder.php b/src/core/Sitemap/SitemapBuilder.php index ee78297..ab4f43e 100644 --- a/src/core/Sitemap/SitemapBuilder.php +++ b/src/core/Sitemap/SitemapBuilder.php @@ -137,13 +137,12 @@ class SitemapBuilder protected function getAnnotation(Node $node) { try { - $annotation = $this->annotationReader->getMethodAnnotation( - new \ReflectionMethod($node->getController()), - UrlGenerator::class - ); + $reflection = new \ReflectionMethod($node->getController()); - if ($annotation) { - return $annotation; + foreach ($reflection->getAttributes() as $attribute) { + if (UrlGenerator::class === $attribute->getName()) { + return $attribute->newInstance(); + } } } catch (\ReflectionException $e) { return false;