App::appRoutes()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
c 0
b 0
f 0
dl 0
loc 6
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Routes;
4
5
use CoffeeCode\Router\Router;
6
use ThallesDella\FactoryRouter\Routes;
7
8
/**
9
 * Factory Router | Class main [ EXAMPLE ]
10
 *
11
 * @category FactoryRouter\Examples\Routes
12
 * @package  Routes
13
 * @author   Thalles D. koester <[email protected]>
14
 * @license  https://choosealicense.com/licenses/mit/ MIT
15
 * @link     https://github.com/thallesdella/factory-router
16
 */
17
class App extends Routes
18
{
19
    /**
20
     * App constructor.
21
     *
22
     * @param Router $router Router object
23
     */
24
    public function __construct(Router $router)
25
    {
26
        parent::__construct($router, 'App');
27
    }
28
    
29
    /**
30
     * @return Router
31
     */
32
    public function updateRouter(): Router
33
    {
34
        $this->appRoutes();
35
        return $this->router;
36
    }
37
    
38
    /**
39
     * @return void
40
     */
41
    private function appRoutes(): void
42
    {
43
        $this->group('app');
44
        
45
        $this->get('/', 'home');
46
        $this->get('/logout', 'logout');
47
    }
48
}