Code Duplication    Length = 13-15 lines in 2 locations

src/Form/Field/HasMany.php 1 location

@@ 120-134 (lines=15) @@
117
     * @param $relationName
118
     * @param array $arguments
119
     */
120
    public function __construct($relationName, $arguments = [])
121
    {
122
        $this->relationName = $relationName;
123
124
        $this->column = $relationName;
125
126
        if (count($arguments) == 1) {
127
            $this->label = $this->formatLabel();
128
            $this->builder = $arguments[0];
129
        }
130
131
        if (count($arguments) == 2) {
132
            list($this->label, $this->builder) = $arguments;
133
        }
134
    }
135
136
    /**
137
     * Get validator for this field.

src/Form/Field/Embeds.php 1 location

@@ 68-80 (lines=13) @@
65
     * @param string $column
66
     * @param array  $arguments
67
     */
68
    public function __construct($column, $arguments = [])
69
    {
70
        $this->column = $column;
71
72
        if (count($arguments) == 1) {
73
            $this->label = $this->formatLabel();
74
            $this->builder = $arguments[0];
75
        }
76
77
        if (count($arguments) == 2) {
78
            list($this->label, $this->builder) = $arguments;
79
        }
80
    }
81
82
    /**
83
     * Prepare input data for insert or update.