Passed
Push — master ( d1e1bf...0a0bcf )
by Bruno
06:16
created

Renderable_pagination::editable()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 3
dl 0
loc 3
rs 10
1
<?php declare(strict_types=1);
2
3
namespace Formularium\Frontend\Buefy\Renderable;
4
5
use Formularium\Field;
6
use Formularium\Frontend\Buefy\RenderableBuefyInputTrait;
7
use Formularium\HTMLElement;
8
9
class Renderable_pagination extends \Formularium\Renderable
10
{
11
    public function viewable($value, Field $field, HTMLElement $previous): HTMLElement
12
    {
13
        return $this->pagination($value, $field, $previous);
14
    }
15
16
    public function editable($value, Field $field, HTMLElement $previous): HTMLElement
17
    {
18
        return $this->pagination($value, $field, $previous);
19
    }
20
21
    /**
22
     * @param mixed $value
23
     * @param Field $field
24
     * @param HTMLElement $previous
25
     * @return HTMLElement
26
     */
27
    protected function pagination($value, Field $field, HTMLElement $previous): HTMLElement
0 ignored issues
show
Unused Code introduced by
The parameter $previous 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

27
    protected function pagination($value, Field $field, /** @scrutinizer ignore-unused */ HTMLElement $previous): HTMLElement

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 $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

27
    protected function pagination(/** @scrutinizer ignore-unused */ $value, Field $field, HTMLElement $previous): HTMLElement

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...
28
    {
29
        $p = HTMLElement::factory(
30
            'b-pagination',
31
            [
32
                ':total' => $field->getName() . ".total",
33
                ':current.sync' => $field->getName() . ".current_page",
34
                ':per-page' => $field->getName() . ".per_page"
35
            ]
36
        );
37
38
        return $p;
39
    }
40
}
41