anonymous()
last analyzed

Size

Total Lines 18
Code Lines 12

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 12
nc 1
nop 1
dl 0
loc 18
c 0
b 0
f 0
1
<?php
0 ignored issues
show
Coding Style introduced by
There must be no blank lines before the file comment
Loading history...
Coding Style introduced by
The PHP open tag does not have a corresponding PHP close tag
Loading history...
2
3
/**
4
 * Routes configuration.
0 ignored issues
show
introduced by
The second line in the file doc comment must be "@file"
Loading history...
5
 *
6
 * In this file, you set up routes to your controllers and their actions.
7
 * Routes are very important mechanism that allows you to freely connect
8
 * different URLs to chosen controllers and their actions (functions).
9
 *
10
 * It's loaded within the context of `Application::routes()` method which
11
 * receives a `RouteBuilder` instance `$routes` as method argument.
12
 *
13
 * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
14
 * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
15
 *
16
 * Licensed under The MIT License
17
 * For full copyright and license information, please see the LICENSE.txt
18
 * Redistributions of files must retain the above copyright notice.
19
 *
20
 * @copyright     Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
0 ignored issues
show
introduced by
Tag value indented incorrectly; expected 1 space but found 5
Loading history...
Coding Style introduced by
@copyright tag must contain a year and the name of the copyright holder
Loading history...
Coding Style Documentation introduced by
Expected "xxxx-xxxx Squiz Pty Ltd (ABN 77 084 670 600)" for copyright declaration
Loading history...
Coding Style introduced by
The tag in position 1 should be the @package tag
Loading history...
21
 * @link          https://cakephp.org CakePHP(tm) Project
0 ignored issues
show
Coding Style introduced by
The tag in position 2 should be the @subpackage tag
Loading history...
Coding Style introduced by
The tag in position 2 should be the @license tag
Loading history...
introduced by
Tag value indented incorrectly; expected 1 space but found 10
Loading history...
22
 * @license       https://opensource.org/licenses/mit-license.php MIT License
0 ignored issues
show
introduced by
Tag value indented incorrectly; expected 1 space but found 7
Loading history...
Coding Style introduced by
The tag in position 3 should be the @author tag
Loading history...
23
 */
0 ignored issues
show
Coding Style introduced by
PHP version not specified
Loading history...
Coding Style introduced by
There must be exactly one blank line after the file comment
Loading history...
Coding Style Documentation introduced by
Missing @package tag in file comment
Loading history...
Coding Style introduced by
Missing @category tag in file comment
Loading history...
Coding Style introduced by
Header blocks must be separated by a single blank line
Loading history...
Coding Style Documentation introduced by
Missing @author tag in file comment
Loading history...
Coding Style Documentation introduced by
Missing @subpackage tag in file comment
Loading history...
24
use Cake\Routing\Route\DashedRoute;
25
use Cake\Routing\RouteBuilder;
26
27
/*
28
 * The default class to use for all routes
29
 *
30
 * The following route classes are supplied with CakePHP and are appropriate
31
 * to set as the default:
32
 *
33
 * - Route
34
 * - InflectedRoute
35
 * - DashedRoute
36
 *
37
 * If no call is made to `Router::defaultRouteClass()`, the class used is
38
 * `Route` (`Cake\Routing\Route\Route`)
39
 *
40
 * Note that `Route` does not do any inflections on URLs which will result in
41
 * inconsistently cased URLs when used with `:plugin`, `:controller` and
42
 * `:action` markers.
43
 */
0 ignored issues
show
Coding Style introduced by
Empty line required after block comment
Loading history...
44
/** @var \Cake\Routing\RouteBuilder $routes */
0 ignored issues
show
Coding Style introduced by
The open comment tag must be the only content on the line
Loading history...
Coding Style introduced by
Missing short description in doc comment
Loading history...
Coding Style introduced by
The close comment tag must be the only content on the line
Loading history...
Coding Style introduced by
Inline doc block comments are not allowed; use "/* Comment */" or "// Comment" instead
Loading history...
Coding Style introduced by
Block comments must be started with /*
Loading history...
45
$routes->setRouteClass(DashedRoute::class);
46
47
$routes->scope('/', function (RouteBuilder $builder) {
0 ignored issues
show
Coding Style introduced by
Expected 0 blank lines after opening function brace; 1 found
Loading history...
48
49
    $builder->prefix('admin', function($routes) {
0 ignored issues
show
Coding Style introduced by
Expected 1 space after FUNCTION keyword; 0 found
Loading history...
50
        $routes->connect('/', ['controller' => 'Users', 'action' => 'index']);
51
        $routes->connect('/users/index', ['controller' => 'Users', 'action' => 'index']);
52
        $routes->connect('/users/login', ['controller' => 'Users', 'action' => 'login']);
53
        $routes->connect('/users/logout', ['controller' => 'Users', 'action' => 'logout']);
54
        $routes->fallbacks(DashedRoute::class);
55
    });
56
57
    $builder->prefix('profile', function($routes) {
0 ignored issues
show
Coding Style introduced by
Expected 1 space after FUNCTION keyword; 0 found
Loading history...
58
        $routes->fallbacks(DashedRoute::class);
59
    });
60
0 ignored issues
show
Coding Style introduced by
Functions must not contain multiple empty lines in a row; found 2 empty lines
Loading history...
61
62
    $builder->connect('/', ['controller' => 'dashboard', 'action' => 'index']);
63
    $builder->connect('/pages/*', ['controller' => 'Pages', 'action' => 'display']);
64
    $builder->fallbacks();
65
});
66