Completed
Push — master ( 8801ad...e19554 )
by Alexpts
02:50
created

CollectionRoute::getRoutes()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 2
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
    public function add(string $name, Route $route, int $priority = 50)
11
    {
12
        return $this->addItem($name, $route, $priority);
13
    }
14
15
    public function remove(string $name) : CollectionRoute
16
    {
17
        return $this->removeItemWithoutPriority($name);
18
    }
19
20
    /**
21
     * @return Route[]
22
     */
23
    public function getRoutes() : array
24
    {
25
        return $this->getFlatItems(true);
26
    }
27
}
28