Code Duplication    Length = 8-9 lines in 2 locations

src/Html.php 2 locations

@@ 346-353 (lines=8) @@
343
     *
344
     * @return \Spatie\Html\Elements\Select
345
     */
346
    public function select($name = null, $options = [], $value = null)
347
    {
348
        return Select::create()
349
            ->attributeIf($name, 'name', $this->fieldName($name))
350
            ->attributeIf($name, 'id', $this->fieldName($name))
351
            ->options($options)
352
            ->value($name ? $this->old($name, $value) : $value);
353
    }
354
355
    /**
356
     * @param \Spatie\Html\HtmlElement|string|null $contents
@@ 289-297 (lines=9) @@
286
     *
287
     * @return \Spatie\Html\Elements\Select
288
     */
289
    public function multiselect($name = null, $options = [], $value = null)
290
    {
291
        return Select::create()
292
            ->attributeIf($name, 'name', $this->fieldName($name))
293
            ->attributeIf($name, 'id', $this->fieldName($name))
294
            ->options($options)
295
            ->value($name ? $this->old($name, $value) : $value)
296
            ->multiple();
297
    }
298
299
    /**
300
     * @param string|null $text