ModuleCommands   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 4
c 1
b 0
f 0
dl 0
loc 10
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getModuleName() 0 8 2
1
<?php
2
3
namespace Rawilk\LaravelModules\Traits;
4
5
/**
6
 * @mixin \Illuminate\Console\Command
7
 */
8
trait ModuleCommands
9
{
10
    public function getModuleName(): string
11
    {
12
        $moduleName = $this->argument('module') ?: app('modules')->getUsedNow();
0 ignored issues
show
Bug introduced by
It seems like argument() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

12
        $moduleName = $this->/** @scrutinizer ignore-call */ argument('module') ?: app('modules')->getUsedNow();
Loading history...
Bug introduced by
The method getUsedNow() does not exist on Illuminate\Contracts\Foundation\Application. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

12
        $moduleName = $this->argument('module') ?: app('modules')->/** @scrutinizer ignore-call */ getUsedNow();

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
13
14
        /** @var \Rawilk\LaravelModules\Module $module */
15
        $module = app('modules')->findOrFail($moduleName);
0 ignored issues
show
Bug introduced by
The method findOrFail() does not exist on Illuminate\Contracts\Foundation\Application. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

15
        $module = app('modules')->/** @scrutinizer ignore-call */ findOrFail($moduleName);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
16
17
        return $module->getStudlyName();
18
    }
19
}
20