Passed
Branch master (5a7b25)
by Arman
03:56
created

RouteController::getRoutes()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
/**
4
 * Quantum PHP Framework
5
 *
6
 * An open source software development framework for PHP
7
 *
8
 * @package Quantum
9
 * @author Arman Ag. <[email protected]>
10
 * @copyright Copyright (c) 2018 Softberg LLC (https://softberg.org)
11
 * @link http://quantum.softberg.org/
12
 * @since 2.9.0
13
 */
14
15
namespace Quantum\Router;
16
17
/**
18
 * RouterController Class
19
 * @package Quantum\Router
20
 */
21
abstract class RouteController
22
{
23
24
    /**
25
     * Contains current route information
26
     * @var array
27
     */
28
    protected static $currentRoute = null;
29
30
    /**
31
     * Gets the current route
32
     * @return array
33
     */
34
    public static function getCurrentRoute(): ?array
35
    {
36
        return self::$currentRoute;
37
    }
38
39
    /**
40
     * @param array $route
41
     */
42
    public static function setCurrentRoute(array $route)
43
    {
44
        self::$currentRoute = $route;
45
    }
46
47
    /**
48
     * Set Routes
49
     * @param array $routes
50
     */
51
    public static function setRoutes(array $routes)
52
    {
53
        static::$routes = $routes;
0 ignored issues
show
Bug Best Practice introduced by
The property routes does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
54
    }
55
56
    /**
57
     * Get Routes
58
     * @return array
59
     */
60
    public static function getRoutes(): array
61
    {
62
        return static::$routes;
63
    }
64
65
}
66