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

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