Passed
Push — develop ( 1c9254...e0f0df )
by Daniel
04:57
created

Menu::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 3
nc 1
nop 0
dl 0
loc 5
ccs 4
cts 4
cp 1
crap 1
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace Silverback\ApiComponentBundle\Entity\Content\Component\Navigation\Menu;
4
5
use ApiPlatform\Core\Annotation\ApiResource;
6
use Doctrine\ORM\Mapping as ORM;
7
use Silverback\ApiComponentBundle\Entity\Content\Component\Navigation\AbstractNavigation;
8
use Silverback\ApiComponentBundle\Entity\Content\ComponentGroup;
9
10
/**
11
 * Class Menu
12
 * @package Silverback\ApiComponentBundle\Entity\Content\Component\Navigation\Menu
13
 * @author Daniel West <[email protected]>
14
 * @ApiResource()
15
 * @ORM\Entity()
16
 */
17
class Menu extends AbstractNavigation
18
{
19 2
    public function __construct()
20
    {
21 2
        parent::__construct();
22 2
        $this->addValidComponent(MenuItem::class);
23 2
        $this->addComponentGroup(new ComponentGroup());
24 2
    }
25
26
    public function onDeleteCascade(): bool
27
    {
28
        return true;
29
    }
30
}
31