Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

Passed
Pull Request — crud-uploads (#5038)
by Pedro
13:06
created

ValidBackpackUpload::setData()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 5
rs 10
1
<?php
2
3
namespace Backpack\CRUD\app\Library\Uploaders\Validation;
4
5
use Closure;
6
use Illuminate\Contracts\Validation\DataAwareRule;
7
use Illuminate\Contracts\Validation\ValidationRule;
0 ignored issues
show
Bug introduced by
The type Illuminate\Contracts\Validation\ValidationRule was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
8
use Illuminate\Contracts\Validation\ValidatorAwareRule;
9
use Illuminate\Validation\Rules\File;
10
11
class ValidBackpackUpload implements ValidationRule, DataAwareRule, ValidatorAwareRule
12
{
13
    /**
14
     * @var \Illuminate\Contracts\Validation\Validator
15
     */
16
    protected $validator;
17
18
    protected array $data;
19
20
    public $arrayRules = [];
21
22
    public $fileRules = [];
23
24
    public static function make(): self
25
    {
26
        return new static();
27
    }
28
29
    /**
30
     * Run the validation rule.
31
     *
32
     * @param  string  $attribute
33
     * @param  mixed  $value
34
     * @param  \Closure(string): \Illuminate\Translation\PotentiallyTranslatedString  $fail
35
     * @return void
36
     */
37
    public function validate(string $attribute, mixed $value, Closure $fail): void
38
    {
39
    }
40
41
    public function arrayRules(string|array|File $rules): self
42
    {
43
        if (is_string($rules)) {
0 ignored issues
show
introduced by
The condition is_string($rules) is always false.
Loading history...
44
            $rules = explode('|', $rules);
45
        }
46
47
        if (! in_array('array', $rules)) {
48
            $rules[] = 'array';
49
        }
50
51
        $this->arrayRules = $rules;
52
53
        return $this;
54
    }
55
56
    public function fileRules(string|array|File $rules): self
57
    {
58
        if (is_string($rules)) {
0 ignored issues
show
introduced by
The condition is_string($rules) is always false.
Loading history...
59
            $rules = explode('|', $rules);
60
        }
61
        if (! is_array($rules)) {
0 ignored issues
show
introduced by
The condition is_array($rules) is always true.
Loading history...
62
            $rules = [$rules];
63
        }
64
        $this->fileRules = $rules;
65
66
        return $this;
67
    }
68
69
    /**
70
     * Set the performing validator.
71
     *
72
     * @param  \Illuminate\Contracts\Validation\Validator  $validator
73
     * @return $this
74
     */
75
    public function setValidator($validator)
76
    {
77
        $this->validator = $validator;
78
79
        return $this;
80
    }
81
82
    /**
83
     * Set the data under validation.
84
     *
85
     * @param  array  $data
86
     * @return $this
87
     */
88
    public function setData($data)
89
    {
90
        $this->data = $data;
91
92
        return $this;
93
    }
94
}
95