1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
namespace Everlution\NavigationBundle\Twig; |
6
|
|
|
|
7
|
|
|
use Everlution\Navigation\Builder\MatcherInterface; |
8
|
|
|
use Everlution\Navigation\ContainerRegistry; |
|
|
|
|
9
|
|
|
use Everlution\Navigation\ContainerBuilder\ContainerMatcherInterface; |
|
|
|
|
10
|
|
|
use Everlution\Navigation\ContainerBuilder\NavigationBuilder; |
|
|
|
|
11
|
|
|
use Everlution\Navigation\ContainerBuilder\AdvancedNavigationInterface; |
|
|
|
|
12
|
|
|
use Everlution\Navigation\Item\ItemInterface; |
13
|
|
|
use Everlution\Navigation\Url\CannotProvideUrlForItemException; |
14
|
|
|
use Everlution\Navigation\Url\UrlProviderContainer; |
15
|
|
|
use Everlution\NavigationBundle\Bridge\Item\TranslatableItemLabelInterface; |
16
|
|
|
use Everlution\NavigationBundle\Bridge\NavigationAliasContainer; |
17
|
|
|
use Symfony\Component\Translation\TranslatorInterface; |
18
|
|
|
|
19
|
|
|
/** |
20
|
|
|
* Class AdvancedNavigationHelper |
21
|
|
|
* |
22
|
|
|
* @author Martin Lutter <[email protected]> |
23
|
|
|
*/ |
24
|
|
|
class AdvancedNavigationHelper |
25
|
|
|
{ |
26
|
|
|
/** @var ContainerRegistry */ |
27
|
|
|
private $registry; |
28
|
|
|
/** @var NavigationAliasContainer */ |
29
|
|
|
private $aliasContainer; |
30
|
|
|
/** @var MatcherInterface */ |
31
|
|
|
private $matcher; |
32
|
|
|
/** @var NavigationBuilder[] */ |
33
|
|
|
private $container = []; |
34
|
|
|
|
35
|
|
|
public function __construct( |
36
|
|
|
ContainerRegistry $registry, |
37
|
|
|
NavigationAliasContainer $aliasContainer, |
38
|
|
|
MatcherInterface $matcher |
39
|
|
|
) { |
40
|
|
|
$this->registry = $registry; |
41
|
|
|
$this->aliasContainer = $aliasContainer; |
42
|
|
|
$this->matcher = $matcher; |
43
|
|
|
} |
44
|
|
|
|
45
|
|
|
public function isCurrent(ItemInterface $item): bool |
46
|
|
|
{ |
47
|
|
|
return $this->matcher->isCurrent($item); |
48
|
|
|
} |
49
|
|
|
|
50
|
|
|
public function getNavigation(string $navigation): NavigationBuilder |
51
|
|
|
{ |
52
|
|
|
if (false === array_key_exists($navigation, $this->container)) { |
53
|
|
|
$container = $this->getContainer($navigation); |
54
|
|
|
$this->container[$navigation] = new NavigationBuilder($container, $this->matcher); |
55
|
|
|
} |
56
|
|
|
|
57
|
|
|
return $this->container[$navigation]; |
58
|
|
|
} |
59
|
|
|
|
60
|
|
|
private function getContainer(string $navigation): AdvancedNavigationInterface |
61
|
|
|
{ |
62
|
|
|
return $this->registry->getContainer($this->aliasContainer->get($navigation)); |
63
|
|
|
} |
64
|
|
|
} |
65
|
|
|
|
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths