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)
|
protected function getAnnotation(Node $node)
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$annotation = $this->annotationReader->getMethodAnnotation(
|
$reflection = new \ReflectionMethod($node->getController());
|
||||||
new \ReflectionMethod($node->getController()),
|
|
||||||
UrlGenerator::class
|
|
||||||
);
|
|
||||||
|
|
||||||
if ($annotation) {
|
foreach ($reflection->getAttributes() as $attribute) {
|
||||||
return $annotation;
|
if (UrlGenerator::class === $attribute->getName()) {
|
||||||
|
return $attribute->newInstance();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (\ReflectionException $e) {
|
} catch (\ReflectionException $e) {
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in a new issue