RoutesTrait   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 6
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 1 Features 0
Metric Value
eloc 3
dl 0
loc 6
rs 10
c 1
b 1
f 0
ccs 2
cts 2
cp 1
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A registerRoutes() 0 4 1
1
<?php
2
3
namespace Nip\Router\ServiceProvider\Traits;
4
5
use Nip\Router\Router;
6
7
/**
8
 * Trait RoutesTrait
9
 * @package Nip\Router\ServiceProvider\Traits
10
 */
11
trait RoutesTrait
12
{
13 3
    public function registerRoutes()
14
    {
15
        $this->getContainer()->singleton('routes', function () {
0 ignored issues
show
Bug introduced by
It seems like getContainer() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

15
        $this->/** @scrutinizer ignore-call */ 
16
               getContainer()->singleton('routes', function () {
Loading history...
16 1
            return $this->getContainer()->get('router')->getRoutes();
17 3
        });
18 3
    }
19
}
20