DropdownBuilderTrait::dropdownMenu()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
1
<?php
2
3
namespace Lagdo\UiBuilder\Builder;
4
5
use Lagdo\UiBuilder\Component\Base;
6
7
trait DropdownBuilderTrait
8
{
9
    /**
10
     * @var string
11
     */
12
    protected string $dropdownComponentClass = '';
13
14
    /**
15
     * @var string
16
     */
17
    protected string $dropdownItemComponentClass = '';
18
19
    /**
20
     * @var string
21
     */
22
    protected string $dropdownMenuComponentClass = '';
23
24
    /**
25
     * @var string
26
     */
27
    protected string $dropdownMenuItemComponentClass = '';
28
29
    /**
30
     * @inheritDoc
31
     */
32
    public function dropdown(...$arguments): Base\DropdownComponent
33
    {
34
        return $this->createComponentOfClass($this->dropdownComponentClass, $arguments);
0 ignored issues
show
Bug introduced by
It seems like createComponentOfClass() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

34
        return $this->/** @scrutinizer ignore-call */ createComponentOfClass($this->dropdownComponentClass, $arguments);
Loading history...
35
    }
36
37
    /**
38
     * @inheritDoc
39
     */
40
    public function dropdownItem(...$arguments): Base\DropdownItemComponent
41
    {
42
        return $this->createComponentOfClass($this->dropdownItemComponentClass, $arguments);
43
    }
44
45
    /**
46
     * @inheritDoc
47
     */
48
    public function dropdownMenu(...$arguments): Base\DropdownMenuComponent
49
    {
50
        return $this->createComponentOfClass($this->dropdownMenuComponentClass, $arguments);
51
    }
52
53
    /**
54
     * @inheritDoc
55
     */
56
    public function dropdownMenuItem(...$arguments): Base\DropdownMenuItemComponent
57
    {
58
        return $this->createComponentOfClass($this->dropdownMenuItemComponentClass, $arguments);
59
    }
60
}
61