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

CollectionRoute::removeWithPriority()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2
Metric Value
dl 0
loc 8
ccs 4
cts 4
cp 1
rs 9.4285
cc 2
eloc 4
nc 2
nop 2
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 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