1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
/* |
6
|
|
|
* This file is part of the Zikula package. |
7
|
|
|
* |
8
|
|
|
* Copyright Zikula - https://ziku.la/ |
9
|
|
|
* |
10
|
|
|
* For the full copyright and license information, please view the LICENSE |
11
|
|
|
* file that was distributed with this source code. |
12
|
|
|
*/ |
13
|
|
|
|
14
|
|
|
namespace Zikula\ThemeBundle\Tests\ExtensionMenu\Fixtures; |
15
|
|
|
|
16
|
|
|
use Knp\Menu\FactoryInterface; |
|
|
|
|
17
|
|
|
use Knp\Menu\ItemInterface; |
|
|
|
|
18
|
|
|
use Zikula\ThemeBundle\ExtensionMenu\ExtensionMenuInterface; |
19
|
|
|
|
20
|
|
|
class BarExtensionMenu implements ExtensionMenuInterface |
21
|
|
|
{ |
22
|
|
|
public function __construct(private readonly FactoryInterface $factory) |
23
|
|
|
{ |
24
|
|
|
} |
25
|
|
|
|
26
|
|
|
public function get(string $type = self::TYPE_ADMIN): ?ItemInterface |
|
|
|
|
27
|
|
|
{ |
28
|
|
|
$method = 'get' . ucfirst($type); |
29
|
|
|
if (method_exists($this, $method)) { |
30
|
|
|
return $this->{$method}(); |
31
|
|
|
} |
32
|
|
|
|
33
|
|
|
return null; |
|
|
|
|
34
|
|
|
} |
35
|
|
|
|
36
|
|
|
private function getUser(): ?ItemInterface |
37
|
|
|
{ |
38
|
|
|
$menu = $this->factory->createItem('admin'); |
39
|
|
|
$menu->addChild('list', [ |
40
|
|
|
'route' => 'list', |
41
|
|
|
])->setAttribute('icon', 'fas fa-list'); |
42
|
|
|
$menu->addChild('new', [ |
43
|
|
|
'route' => 'edit', |
44
|
|
|
]); |
45
|
|
|
|
46
|
|
|
return $menu; |
47
|
|
|
} |
48
|
|
|
|
49
|
|
|
private function getBar(): ?ItemInterface |
50
|
|
|
{ |
51
|
|
|
$menu = $this->factory->createItem('foo'); |
52
|
|
|
$menu->addChild('bar admin', [ |
53
|
|
|
'route' => 'bar_admin', |
54
|
|
|
])->setAttribute('icon', 'fas fa-plus'); |
55
|
|
|
|
56
|
|
|
return $menu; |
57
|
|
|
} |
58
|
|
|
|
59
|
|
|
private function getAccount(): ?ItemInterface |
60
|
|
|
{ |
61
|
|
|
$menu = $this->factory->createItem('account'); |
62
|
|
|
$menu->addChild('bar acct', [ |
63
|
|
|
'route' => 'bar_acct', |
64
|
|
|
]); |
65
|
|
|
|
66
|
|
|
return $menu; |
67
|
|
|
} |
68
|
|
|
|
69
|
|
|
public function getBundleName(): string |
70
|
|
|
{ |
71
|
|
|
return 'ZikulaBarExtension'; |
72
|
|
|
} |
73
|
|
|
} |
74
|
|
|
|
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