Code Duplication    Length = 13-15 lines in 3 locations

src/Form/Field/Embeds.php 1 location

@@ 23-35 (lines=13) @@
20
     * @param string $column
21
     * @param array  $arguments
22
     */
23
    public function __construct($column, $arguments = [])
24
    {
25
        $this->column = $column;
26
27
        if (count($arguments) == 1) {
28
            $this->label = $this->formatLabel();
29
            $this->builder = $arguments[0];
30
        }
31
32
        if (count($arguments) == 2) {
33
            list($this->label, $this->builder) = $arguments;
34
        }
35
    }
36
37
    /**
38
     * Prepare input data for insert or update.

src/Form/Field/Table.php 1 location

@@ 20-32 (lines=13) @@
17
     * @param string $column
18
     * @param array  $arguments
19
     */
20
    public function __construct($column, $arguments = [])
21
    {
22
        $this->column = $column;
23
24
        if (count($arguments) == 1) {
25
            $this->label = $this->formatLabel();
26
            $this->builder = $arguments[0];
27
        }
28
29
        if (count($arguments) == 2) {
30
            list($this->label, $this->builder) = $arguments;
31
        }
32
    }
33
34
    /**
35
     * @return array

src/Form/Field/HasMany.php 1 location

@@ 83-97 (lines=15) @@
80
     * @param $relationName
81
     * @param array $arguments
82
     */
83
    public function __construct($relationName, $arguments = [])
84
    {
85
        $this->relationName = $relationName;
86
87
        $this->column = $relationName;
88
89
        if (count($arguments) == 1) {
90
            $this->label = $this->formatLabel();
91
            $this->builder = $arguments[0];
92
        }
93
94
        if (count($arguments) == 2) {
95
            list($this->label, $this->builder) = $arguments;
96
        }
97
    }
98
99
    /**
100
     * Get validator for this field.