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

Processable   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 6
c 1
b 0
f 0
dl 0
loc 13
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getProcessor() 0 5 2
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