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 — main (#4854)
by Pedro
30:01 queued 14:59
created

BaseField   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
c 1
b 0
f 0
dl 0
loc 29
rs 10
wmc 3

3 Methods

Rating   Name   Duplication   Size   Complexity  
A attributes() 0 8 1
A __construct() 0 5 1
A make() 0 3 1
1
<?php
2
3
namespace Backpack\CRUD\app\Library\Components;
4
5
use Backpack\CRUD\app\Library\Components\Attributes\Entity;
6
use Backpack\CRUD\app\Library\Components\Attributes\Fields\FieldType;
7
use Backpack\CRUD\app\Library\Components\Attributes\Label;
8
use Backpack\CRUD\app\Library\Components\Attributes\Model;
9
use Backpack\CRUD\app\Library\Components\Attributes\RelationType;
10
use Backpack\CRUD\app\Library\Components\Fields\FieldCollection;
11
12
/**
13
 * @method self type(string $type) the type of the field
14
 * @method self label(string $type) the type of the field
15
 * @method self name()
16
 * @method self value()
17
 * @method self placeholder()
18
 * @method self hint()
19
 * @method self wrapper()
20
 */
21
class BaseField extends BaseComponent
22
{
23
    public function __construct(string|array $attributes)
24
    {
25
        $collection = new FieldCollection($attributes, static::attributes(), static::rules(), static::defaults(), static::blocked());
26
27
        parent::__construct($collection);
28
    }
29
30
    /**
31
     * IMPORTANT: the order of the attributes is important. If you need some attribute that depends on another
32
     * attribute, make sure that the attribute that you need is defined before the attribute that depends on it.
33
     *
34
     * @return array
35
     */
36
    public static function attributes(): array
37
    {
38
        return [
39
            Label::class,
40
            Entity::class,
41
            RelationType::class,
42
            FieldType::class,
43
            Model::class,
44
        ];
45
    }
46
47
    public static function make(string|array $attributes): static
48
    {
49
        return new static($attributes);
50
    }
51
}
52