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
@@ 394-401 (lines=8) @@
391
     *
392
     * @return \Spatie\Html\Elements\Select
393
     */
394
    public function select($name = null, $options = [], $value = null)
395
    {
396
        return Select::create()
397
            ->attributeIf($name, 'name', $this->fieldName($name))
398
            ->attributeIf($name, 'id', $this->fieldName($name))
399
            ->options($options)
400
            ->value($name ? $this->old($name, $value) : $value);
401
    }
402
403
    /**
404
     * @param \Spatie\Html\HtmlElement|string|null $contents