andrey-helldar /
laravel-lang-publisher
| 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
Bug
introduced
by
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 |