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

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