Code Duplication    Length = 8-9 lines in 2 locations

src/Html.php 2 locations

@@ 291-299 (lines=9) @@
288
     *
289
     * @return \Spatie\Html\Elements\Select
290
     */
291
    public function multiselect($name = null, $options = [], $value = null)
292
    {
293
        return Select::create()
294
            ->attributeIf($name, 'name', $this->fieldName($name))
295
            ->attributeIf($name, 'id', $this->fieldName($name))
296
            ->options($options)
297
            ->value($name ? $this->old($name, $value) : $value)
298
            ->multiple();
299
    }
300
301
    /**
302
     * @param string|null $text
@@ 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