Passed
Pull Request — master (#5)
by Ivan
01:48
created

SortableAndRegistrableTrait   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 15
c 0
b 0
f 0
wmc 2
lcom 0
cbo 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getRegisteredContainerNames() 0 4 1
A getOrder() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Everlution\Navigation\Item;
6
7
/**
8
 * Trait SortableAndRegistrableTrait.
9
 *
10
 * @author Ivan Barlog <[email protected]>
11
 */
12
trait SortableAndRegistrableTrait
13
{
14
    /**
15
     * @return string[]
16
     */
17
    public function getRegisteredContainerNames(): array
18
    {
19
        return array_keys(self::CONTAINERS);
20
    }
21
22
    public function getOrder(string $containerName): int
23
    {
24
        return self::CONTAINERS[$containerName];
25
    }
26
}
27