Conditions | 4 |
Paths | 3 |
Total Lines | 17 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
32 | public function resolveValues($value, array $args, ResolveInfo $info) { |
||
33 | if (UrlHelper::isExternal($args['path'])) { |
||
34 | yield Url::fromUri($args['path']); |
||
35 | } |
||
36 | else { |
||
37 | $url = Url::fromUri("internal:{$args['path']}", ['routed_path' => $args['path']]); |
||
38 | if ($url->isRouted() && $url->access()) { |
||
39 | yield $url; |
||
40 | } |
||
41 | else { |
||
42 | $metadata = new CacheableMetadata(); |
||
43 | $metadata->addCacheTags(['4xx-response']); |
||
44 | |||
45 | yield new CacheableValue(NULL, [$metadata]); |
||
46 | } |
||
47 | } |
||
48 | } |
||
49 | |||
51 |