Passed
Push — develop ( 0112d6...38c008 )
by Daniel
05:14
created

NavBar   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Test Coverage

Coverage 71.43%

Importance

Changes 0
Metric Value
eloc 5
dl 0
loc 12
ccs 5
cts 7
cp 0.7143
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A onDeleteCascade() 0 3 1
A __construct() 0 5 1
1
<?php
2
3
namespace Silverback\ApiComponentBundle\Entity\Content\Component\Navigation\NavBar;
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
 * @author Daniel West <[email protected]
12
 * @ORM\Entity()
13
 */
14
class NavBar extends AbstractNavigation
15
{
16 4
    public function __construct()
17
    {
18 4
        parent::__construct();
19 4
        $this->addValidComponent(NavBarItem::class);
20 4
        $this->addComponentGroup(new ComponentGroup());
21 4
    }
22
23
    public function onDeleteCascade(): bool
24
    {
25
        return true;
26
    }
27
}
28