Conditions | 2 |
Paths | 2 |
Total Lines | 18 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 6 |
Changes | 9 | ||
Bugs | 2 | Features | 0 |
1 | <?php |
||
39 | public function all(AuthorizationCheckerInterface $authorizationChecker) |
||
40 | { |
||
41 | $query = $this->connection->prepare('SELECT * FROM url_alias WHERE mode=?'); |
||
42 | $query->execute([UrlAlias::REWRITE]); |
||
43 | $urls = new \ArrayObject($query->fetchAll(\PDO::FETCH_ASSOC)); |
||
44 | |||
45 | /** |
||
46 | * Hook to allow the mapping to be modified at run-time. |
||
47 | */ |
||
48 | if ($this->eventDispatcher->hasListeners(Events::EVENT_SITEMAP_FILTER)) { |
||
49 | $this->eventDispatcher->dispatch(Events::EVENT_SITEMAP_FILTER, new SitemapFilterEvent($urls)); |
||
50 | } |
||
51 | |||
52 | return array_map( |
||
53 | function ($url) { |
||
54 | return ['value' => $url['public_url']]; |
||
55 | }, |
||
56 | $urls->getArrayCopy() |
||
57 | ); |
||
60 |