Code Duplication    Length = 13-15 lines in 2 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/HasMany.php 1 location

@@ 76-90 (lines=15) @@
73
     * @param $relationName
74
     * @param array $arguments
75
     */
76
    public function __construct($relationName, $arguments = [])
77
    {
78
        $this->relationName = $relationName;
79
80
        $this->column = $relationName;
81
82
        if (count($arguments) == 1) {
83
            $this->label = $this->formatLabel();
84
            $this->builder = $arguments[0];
85
        }
86
87
        if (count($arguments) == 2) {
88
            list($this->label, $this->builder) = $arguments;
89
        }
90
    }
91
92
    /**
93
     * Get validator for this field.