GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Push — master ( e13b49...4d90bb )
by Mehdi
12:01
created

DetectionFactory::buildDetections()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
c 0
b 0
f 0
dl 0
loc 8
rs 10
cc 1
nc 1
nop 3
1
<?php
2
3
namespace eloquentFilter\QueryFilter\Detection;
4
5
use eloquentFilter\QueryFilter\Detection\Contract\DetectorFactoryContract;
6
use Illuminate\Database\Eloquent\Model;
7
8
/**
9
 * Class DetectionFactory.
10
 */
11
class DetectionFactory implements DetectorFactoryContract
12
{
13
    /**
14
     * @var array
15
     */
16
    public array $detections;
17
18
    /**
19
     * DetectionFactory constructor.
20
     *
21
     * @param array $detections
22
     */
23
    public function __construct(array $detections)
24
    {
25
        $this->detections = $detections;
26
    }
27
28
    /**
29
     * @param $field
30
     * @param $params
31
     * @param Model|null $model
32
     *
33
     * @return mixed|string|null
34
     * @throws \ReflectionException
35
     *
36
     */
37
    public function buildDetections($field, $params, $model = null): ?string
38
    {
39
        $detect = app(DetectorCondition::class, ['detector' => $this->detections]);
40
41
        /** @see DetectorCondition::detect() */
42
        $method = $detect->detect($field, $params, $model);
0 ignored issues
show
Bug introduced by
It seems like $model can also be of type Illuminate\Database\Eloquent\Model; however, parameter $model of eloquentFilter\QueryFilt...ctorCondition::detect() does only seem to accept null, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

42
        $method = $detect->detect($field, $params, /** @scrutinizer ignore-type */ $model);
Loading history...
43
44
        return $method;
45
    }
46
}
47