Passed
Pull Request — master (#60)
by Andrey
11:17
created

Processable::getProcessor()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 5
rs 10
cc 2
nc 2
nop 0
1
<?php
2
3
namespace Helldar\LaravelLangPublisher\Traits\Containers;
4
5
use Helldar\LaravelLangPublisher\Contracts\Processor;
6
7
trait Processable
8
{
9
    /** @var \Helldar\LaravelLangPublisher\Contracts\Processor */
10
    protected $process_php;
11
12
    /** @var \Helldar\LaravelLangPublisher\Contracts\Processor */
13
    protected $process_json;
14
15
    protected function getProcessor(): Processor
16
    {
17
        return $this->isJson()
0 ignored issues
show
Bug introduced by
It seems like isJson() 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

17
        return $this->/** @scrutinizer ignore-call */ isJson()
Loading history...
18
            ? $this->container($this->process_json)
0 ignored issues
show
Bug introduced by
It seems like container() 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

18
            ? $this->/** @scrutinizer ignore-call */ container($this->process_json)
Loading history...
19
            : $this->container($this->process_php);
20
    }
21
}
22