Completed
Pull Request — master (#47)
by Şəhriyar
33:20
created

LocalizedRoute   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 1
c 0
b 0
f 0
lcom 0
cbo 1
dl 0
loc 11
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
1
<?php namespace App\Services\Routing;
2
3
use Illuminate\Routing\Route;
4
5
class LocalizedRoute extends Route
6
{
7
    /**
8
     * {@inheritdoc}
9
     */
10
    public function __construct($methods, $uri, $action)
11
    {
12
        parent::__construct($methods, $uri, $action);
13
        $this->locale = app('translator')->getLocale();
0 ignored issues
show
Bug introduced by
The property locale does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
14
    }
15
}