RouteCollection   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 1
cbo 0
dl 0
loc 24
ccs 5
cts 5
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A add() 0 4 1
A getIterator() 0 4 1
1
<?php
2
3
namespace Mosaic\Routing;
4
5
use ArrayIterator;
6
use IteratorAggregate;
7
8
class RouteCollection implements IteratorAggregate
9
{
10
    /**
11
     * @var Route[]
12
     */
13
    protected $routes = [];
14
15
    /**
16
     * @param Route $route
17
     */
18 14
    public function add(Route $route)
19
    {
20 14
        $this->routes[] = $route;
21 14
    }
22
23
    /**
24
     * {@inheritdoc}
25
     * @return Route[]
26
     */
27 13
    public function getIterator()
28
    {
29 13
        return new ArrayIterator($this->routes);
30
    }
31
}
32