Code Duplication    Length = 8-9 lines in 2 locations

src/Html.php 2 locations

@@ 324-332 (lines=9) @@
321
     *
322
     * @return \Spatie\Html\Elements\Select
323
     */
324
    public function multiselect($name = null, $options = [], $value = null)
325
    {
326
        return Select::create()
327
            ->attributeIf($name, 'name', $this->fieldName($name))
328
            ->attributeIf($name, 'id', $this->fieldName($name))
329
            ->options($options)
330
            ->value($name ? $this->old($name, $value) : $value)
331
            ->multiple();
332
    }
333
334
    /**
335
     * @param string|null $name
@@ 398-405 (lines=8) @@
395
     *
396
     * @return \Spatie\Html\Elements\Select
397
     */
398
    public function select($name = null, $options = [], $value = null)
399
    {
400
        return Select::create()
401
            ->attributeIf($name, 'name', $this->fieldName($name))
402
            ->attributeIf($name, 'id', $this->fieldName($name))
403
            ->options($options)
404
            ->value($name ? $this->old($name, $value) : $value);
405
    }
406
407
    /**
408
     * @param \Spatie\Html\HtmlElement|string|null $contents