Passed
Push — master ( f55dd4...6ac744 )
by Mohammad
13:39 queued 20s
created

Routes::getRoutes()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: shanmaseen
5
 * Date: 23/03/19
6
 * Time: 08:15 م
7
 */
8
9
namespace Shamaseen\Laravel\Ratchet\Routes;
10
11
/**
12
 * Class Routes
13
 * @package App\WebSockets\Routes
14
 */
15
class Routes
16
{
17
    public $routes = [
18
19
    ];
20
21
    function mainRoutes()
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
22
    {
23
        $this->make('initializeWebsocket','Shamaseen\Laravel\Ratchet\Controllers\InitializeController','index');
24
    }
25
26
    /**
27
     * @param $routeName
28
     * @param $controller
29
     * @param $method
30
     * @param bool $authenticated
31
     */
32
    function make($routeName, $controller, $method,$authenticated = true)
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
33
    {
34
        $this->routes[$routeName] = (object) [
35
            'controller'=>$controller,
36
            'method'=>$method,
37
            'auth'=> $authenticated
38
        ];
39
    }
40
41
    function getRoutes()
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
42
    {
43
        return $this->routes;
44
    }
45
}