Issues (65)

src/Traits/ModuleCommands.php (3 issues)

Labels
Severity
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
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...
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
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