Passed
Push — master ( ce74a0...f5af85 )
by Bruno
09:32
created

Renderable_relationship::editable()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
cc 2
eloc 3
c 1
b 1
f 0
nc 2
nop 3
dl 0
loc 7
rs 10
1
<?php declare(strict_types=1);
2
3
namespace Modelarium\Frontend\Bootstrap\Renderable;
4
5
use Formularium\Field;
6
use Formularium\Frontend\Bootstrap\RenderableBootstrapWrapperTrait;
0 ignored issues
show
Bug introduced by
The type Formularium\Frontend\Boo...leBootstrapWrapperTrait 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...
7
use Formularium\Renderable;
8
use Formularium\HTMLNode;
9
10
class Renderable_relationship extends Renderable
11
{
12
    use RenderableBootstrapWrapperTrait;
13
    
14
    public function viewable($value, Field $field, HTMLNode $previous): HTMLNode
15
    {
16
        return $previous;
17
    }
18
19
    /**
20
     * Subcall of wrapper editable() from RenderableMaterializeTrait
21
     *
22
     * @param mixed $value
23
     * @param Field $field
24
     * @param HTMLNode $previous
25
     * @return HTMLNode
26
     */
27
    public function editable($value, Field $field, HTMLNode $previous): HTMLNode
28
    {
29
        foreach ($previous->get('select') as $input) {
30
            $input->addAttribute('class', 'custom-select');
31
        }
32
33
        return $this->wrapper($value, $field, $this->bootstrapify($value, $field, $previous, 'select'));
34
    }
35
}
36