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 — master (#2951)
by Cristian
07:25
created

FieldGroup   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A __call() 0 8 2
1
<?php
2
3
namespace Backpack\CRUD\app\Library\CrudPanel;
4
5
class FieldGroup
6
{
7
    protected $fields;
8
9
    public function __construct(...$fields)
10
    {
11
        $this->fields = $fields;
12
    }
13
14
    // -------------
15
    // MAGIC METHODS
16
    // -------------
17
18
    /**
19
     * We foward any call into FieldGroup class to the Field class once per defined field.
20
     *
21
     * @param  string $method     The method being called that doesn't exist.
22
     * @param  array $parameters  The arguments when that method was called.
23
     *
24
     * @return FieldGroup
25
     */
26
    public function __call($method, $parameter)
27
    {
28
        foreach ($this->fields as $field) {
29
            $field->{$method}($parameter[0]);
30
            $field->save();
31
        }
32
33
        return $this;
34
    }
35
}
36