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

CollectionRoute::isHas()   A

Complexity

Conditions 3
Paths 3

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 3
Metric Value
dl 0
loc 10
ccs 5
cts 5
cp 1
rs 9.4285
cc 3
eloc 5
nc 3
nop 1
crap 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A CollectionRoute::getRoutes() 0 4 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