Completed
Push — master ( f3c8e7...741696 )
by Alexpts
02:57
created

CollectionRoute::getRoutes()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
declare(strict_types=1);
3
namespace PTS\Routing;
4
5
use PTS\Tools\Collection;
6
7
class CollectionRoute extends Collection
8
{
9
10 10
    public function add(string $name, Route $route, int $priority = 50)
11
    {
12 10
        return $this->addItem($name, $route, $priority);
13
    }
14
15 1
    public function remove(string $name) : CollectionRoute
16
    {
17 1
        return $this->removeItemWithoutPriority($name);
18
    }
19
20
    /**
21
     * @return Route[]
22
     */
23 9
    public function getRoutes() : array
24
    {
25 9
        return $this->getFlatItems(true);
26
    }
27
}
28