Code Duplication    Length = 12-14 lines in 2 locations

src/Form.php 1 location

@@ 729-740 (lines=12) @@
726
     *
727
     * @return Field|void
728
     */
729
    public function __call($method, $arguments)
730
    {
731
        if ($className = static::findFieldClass($method)) {
732
            $column = array_get($arguments, 0, ''); //[0];
733
734
            $element = new $className($column, array_slice($arguments, 1));
735
736
            $this->pushField($element);
737
738
            return $element;
739
        }
740
    }
741
742
    public static function findFieldClass($method)
743
    {

src/Widgets/Form.php 1 location

@@ 176-189 (lines=14) @@
173
     *
174
     * @return Field|null
175
     */
176
    public function __call($method, $arguments)
177
    {
178
        if ($className = static::findFieldClass($method)) {
179
            $name = array_get($arguments, 0, ''); //[0];
180
181
            $element = new $className($name, array_slice($arguments, 1));
182
183
            $this->pushField($element);
184
185
            return $element;
186
        }
187
188
        return null;
189
    }
190
191
    /**
192
     * Render the form.