Passed
Branch v2-dev (d50d65)
by Henri
01:22
created

CurrentTrait   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
dl 0
loc 19
rs 10
c 1
b 0
f 0
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A currentAction() 0 4 1
A current() 0 4 1
A currentName() 0 4 1
1
<?php
2
3
namespace HnrAzevedo\Router;
4
5
trait CurrentTrait{
6
    use Helper;
7
8
    public static function current(): array
9
    {
10
        self::getInstance()->hasCurrentRoute();
11
        return self::getInstance()->currentRoute;
0 ignored issues
show
Bug introduced by
The property currentRoute is declared private in HnrAzevedo\Router\Router and cannot be accessed from this context.
Loading history...
12
    }
13
14
    public static function currentName(): string
15
    {
16
        self::getInstance()->hasCurrentRoute();
17
        return self::getInstance()->currentRoute['name'];
0 ignored issues
show
Bug introduced by
The property currentRoute is declared private in HnrAzevedo\Router\Router and cannot be accessed from this context.
Loading history...
18
    }
19
20
    public static function currentAction()
21
    {
22
        self::getInstance()->hasCurrentRoute();
23
        return self::getInstance()->currentRoute['action'];
0 ignored issues
show
Bug introduced by
The property currentRoute is declared private in HnrAzevedo\Router\Router and cannot be accessed from this context.
Loading history...
24
    }
25
    
26
}
27