Renderable_text::_editable()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 14
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 1 Features 1
Metric Value
cc 2
eloc 7
c 2
b 1
f 1
nc 2
nop 3
dl 0
loc 14
rs 10
1
<?php declare(strict_types=1);
2
3
namespace Formularium\Frontend\Bootstrap\Renderable;
4
5
use Formularium\Field;
6
use Formularium\HTMLNode;
7
8
class Renderable_text extends Renderable_string
9
{
10
    /**
11
     * Subcall of wrapper editable() from RenderableMaterializeTrait
12
     *
13
     * @param mixed $value
14
     * @param Field $field
15
     * @param HTMLNode $previous
16
     * @return HTMLNode
17
     */
18
    public function _editable($value, Field $field, HTMLNode $previous): HTMLNode
0 ignored issues
show
Unused Code introduced by
The parameter $value is not used and could be removed. ( Ignorable by Annotation )

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

18
    public function _editable(/** @scrutinizer ignore-unused */ $value, Field $field, HTMLNode $previous): HTMLNode

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $field is not used and could be removed. ( Ignorable by Annotation )

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

18
    public function _editable($value, /** @scrutinizer ignore-unused */ Field $field, HTMLNode $previous): HTMLNode

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
19
    {
20
        // add extra classes
21
        $previous->get('textarea')[0]->setAttributes([
22
            'class' => 'form-control',
23
        ]);
24
        $comment = $previous->get('.formularium-comment');
25
        if (!empty($comment)) {
26
            $comment[0]->setTag('small')->addAttributes([
27
                'class' => 'form-text text-muted',
28
            ]);
29
        }
30
31
        return $previous;
32
    }
33
}
34