SortableAndRegistrableTrait   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
wmc 2
eloc 3
c 1
b 1
f 0
dl 0
loc 13
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getRegisteredContainerNames() 0 3 1
A getOrder() 0 3 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(get_called_class()::CONTAINERS);
20
    }
21
22
    public function getOrder(string $containerName): int
23
    {
24
        return get_called_class()::CONTAINERS[$containerName];
25
    }
26
}
27