Passed
Pull Request — 2.x (#1360)
by Harings
14:11
created

Repeater   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 9
c 2
b 0
f 0
dl 0
loc 25
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A render() 0 3 1
A __construct() 0 14 1
1
<?php
2
3
namespace A17\Twill\View\Components;
4
5
class Repeater extends TwillFormComponent
6
{
7
    public $buttonAsLink;
8
    public $type;
9
    public $max;
10
11
    public function __construct(
12
        $type,
13
        $name = null,
14
        $buttonAsLink = false,
15
        $renderForBlocks = false,
16
        $renderForModal = false,
17
        $max = null
18
    )
19
    {
20
        parent::__construct($name ?? $type, $name, $renderForBlocks, $renderForModal);
21
22
        $this->buttonAsLink = $buttonAsLink;
23
        $this->type = $type;
24
        $this->max = $max;
25
    }
26
27
    public function render()
28
    {
29
        return view('twill::partials.form._repeater');
30
    }
31
}
32