From 173ed9aa83f701dc5c55ef3467e9cbd98dff296b Mon Sep 17 00:00:00 2001 From: Simon Vieille Date: Sat, 19 Nov 2022 20:32:17 +0100 Subject: [PATCH] update sitemap to use attributes instead of annotations --- src/core/Sitemap/SitemapBuilder.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) 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;