Passed
Push — master ( 47699c...d74cf0 )
by Rougin
01:47
created

CompositeRouter::merge()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 1.008

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 7
ccs 4
cts 5
cp 0.8
crap 1.008
rs 9.4285
1
<?php
2
3
namespace App\Zapheus;
4
5
use Zapheus\Routing\Router;
6
use Zapheus\Routing\RouterInterface;
7
8
/**
9
 * Route Collection
10
 *
11
 * @package App
12
 * @author  Rougin Royce Gutib <[email protected]>
13
 */
14
class CompositeRouter extends Router
15
{
16
    /**
17
     * Merges the new route instances.
18
     *
19
     * @param  \Zapheus\Routing\RouterInterface $router
20
     * @return self
21
     */
22 6
    public function merge(RouterInterface $router)
23
    {
24 6
        $routes = $router->routes();
25
26 6
        $this->routes = array_merge($this->routes, $routes);
27
28 6
        return $this;
29
    }
30
}
31