Issues (22)

src/Traits/Containers/Processable.php (1 issue)

Labels
Severity
1
<?php
2
3
namespace Helldar\LaravelLangPublisher\Traits\Containers;
4
5
use Helldar\LaravelLangPublisher\Contracts\Pathable as PathContract;
6
use Helldar\LaravelLangPublisher\Contracts\Processor;
7
use Illuminate\Container\Container;
8
9
trait Processable
10
{
11
    /** @var string */
12
    protected $processor;
13 78
14
    protected function getProcessor(): Processor
15 78
    {
16
        return $this->makeProcessor($this->processor, $this->getPath());
0 ignored issues
show
It seems like getPath() 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

16
        return $this->makeProcessor($this->processor, $this->/** @scrutinizer ignore-call */ getPath());
Loading history...
17 78
    }
18
19
    protected function makeProcessor(string $processor, PathContract $path = null): Processor
20
    {
21
        $path = $path ?: $this->getPath();
22
23
        return Container::getInstance()->make($processor, compact('path'));
24
    }
25
}
26