1 | <?php |
||
2 | |||
3 | namespace AlexBowers\MultipleDashboard\Console\Commands; |
||
4 | |||
5 | use Illuminate\Console\GeneratorCommand; |
||
0 ignored issues
–
show
|
|||
6 | use Illuminate\Support\Str; |
||
0 ignored issues
–
show
The type
Illuminate\Support\Str was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths ![]() |
|||
7 | |||
8 | class CreateDashboard extends GeneratorCommand |
||
9 | { |
||
10 | /** |
||
11 | * The name and signature of the console command. |
||
12 | * |
||
13 | * @var string |
||
14 | */ |
||
15 | protected $signature = 'nova:dashboard {name}'; |
||
16 | |||
17 | /** |
||
18 | * The console command description. |
||
19 | * |
||
20 | * @var string |
||
21 | */ |
||
22 | protected $description = 'Create a dashboard for Nova.'; |
||
23 | |||
24 | /** |
||
25 | * Announce the type for CLI output. |
||
26 | */ |
||
27 | protected $type = 'Dashboard'; |
||
28 | |||
29 | /** |
||
30 | * Build the class with the given name. |
||
31 | * |
||
32 | * @param string $name |
||
33 | * @return string |
||
34 | */ |
||
35 | protected function buildClass($name) |
||
36 | { |
||
37 | $stub = parent::buildClass($name); |
||
38 | |||
39 | $stub = str_replace('uri-key', Str::snake($this->argument('name'), '-'), $stub); |
||
40 | |||
41 | return str_replace('dashboard-name', ucwords(Str::snake($this->argument('name'), ' ')), $stub); |
||
42 | } |
||
43 | |||
44 | /** |
||
45 | * Get the stub file for the generator. |
||
46 | * |
||
47 | * @return string |
||
48 | */ |
||
49 | protected function getStub() |
||
50 | { |
||
51 | return realpath(__DIR__ . '/../stubs/dashboard.stub'); |
||
52 | } |
||
53 | |||
54 | /** |
||
55 | * Get the default namespace for the class. |
||
56 | * |
||
57 | * @param string $rootNamespace |
||
58 | * @return string |
||
59 | */ |
||
60 | protected function getDefaultNamespace($rootNamespace) |
||
61 | { |
||
62 | return $rootNamespace.'\Nova\Dashboards'; |
||
63 | } |
||
64 | } |
||
65 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths