Passed
Push — master ( d2743c...7dbeaf )
by Nícollas
01:44
created

Functions   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A current() 0 3 1
A get() 0 3 1
A collection() 0 3 1
1
<?php
2
3
namespace MinasRouter\Helpers;
4
5
use MinasRouter\Router\Route;
6
7
class Functions
8
{
9
    /**
10
     * Method responsible for returning the
11
     * active RouteCollection instance.
12
     * 
13
     * @return null|\MinasRouter\Router\RouteCollection
14
     */
15
    protected function collection()
16
    {
17
        return Route::$collection;
18
    }
19
20
    /**
21
     * Method responsible for returning a route.
22
     * 
23
     * @param string $name
24
     * 
25
     * @return null|\MinasRouter\Router\RouteManager
26
     */
27
    public function get(String $routerName)
28
    {
29
        return $this->collection()->getByName($routerName);
30
    }
31
32
    /**
33
     * Method responsible for returning the
34
     * current route.
35
     * 
36
     * @return null|\MinasRouter\Router\RouteManager
37
     */
38
    public function current()
39
    {
40
        return $this->collection()->getCurrentRoute();
41
    }
42
}