Passed
Push — develop ( 435f98...653998 )
by Daniel
05:24
created

NavBar::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

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