update sitemap to use attributes instead of annotations
This commit is contained in:
parent
154e6d3e0b
commit
173ed9aa83
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue