1 | <?php |
||||
2 | |||||
3 | namespace VGirol\JsonApi\Commands; |
||||
4 | |||||
5 | use Illuminate\Console\Command; |
||||
6 | use Symfony\Component\Console\Command\Command as SymfonyCommand; |
||||
7 | |||||
8 | trait FixResolveCommand |
||||
9 | { |
||||
10 | protected function resolveCommand($command) |
||||
11 | { |
||||
12 | if (! is_object($command)) { |
||||
13 | if (! class_exists($command)) { |
||||
14 | return $this->getApplication()->find($command); |
||||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||||
15 | } |
||||
16 | |||||
17 | $command = $this->laravel->make($command); |
||||
18 | } |
||||
19 | |||||
20 | if ($command instanceof SymfonyCommand) { |
||||
21 | $command->setApplication($this->getApplication()); |
||||
22 | } |
||||
23 | |||||
24 | if ($command instanceof Command) { |
||||
25 | $command->setLaravel($this->getLaravel()); |
||||
0 ignored issues
–
show
It seems like
getLaravel() 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
![]() |
|||||
26 | } |
||||
27 | |||||
28 | return $command; |
||||
29 | } |
||||
30 | } |
||||
31 |