Completed
Push — develop ( df9395...08456a )
by Abdelrahman
16:28
created

PolicyMakeCommand   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 23
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A replaceUserNamespace() 0 12 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Cortex\Foundation\Console\Commands;
6
7
use Cortex\Foundation\Traits\ConsoleMakeModuleCommand;
8
use Illuminate\Foundation\Console\PolicyMakeCommand as BasePolicyMakeCommand;
9
10
class PolicyMakeCommand extends BasePolicyMakeCommand
11
{
12
    use ConsoleMakeModuleCommand;
13
14
    /**
15
     * Replace the User model namespace.
16
     *
17
     * @param  string  $stub
18
     * @return string
19
     */
20
    protected function replaceUserNamespace($stub)
21
    {
22
        if (! $userModel = config('auth.providers.'.config('auth.guards.'.config('auth.defaults.guard').'.provider').'.model')) {
0 ignored issues
show
Coding Style introduced by
This line exceeds maximum limit of 120 characters; contains 129 characters

Overly long lines are hard to read on any screen. Most code styles therefor impose a maximum limit on the number of characters in a line.

Loading history...
23
            return $stub;
24
        }
25
26
        return str_replace(
27
            $this->rootNamespace().'User',
28
            $userModel,
29
            $stub
30
        );
31
    }
32
}
33