Total Complexity | 4 |
Total Lines | 37 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
6 | trait MaxItemsTrait |
||
7 | { |
||
8 | /** |
||
9 | * Maximum number of selected items. |
||
10 | * |
||
11 | * @var int |
||
12 | */ |
||
13 | protected $max_selected_items; |
||
14 | |||
15 | /** |
||
16 | * Get the maximum number of selected items. |
||
17 | * |
||
18 | * @return int |
||
19 | */ |
||
20 | 6 | public function getMaxSelectedItems() |
|
21 | { |
||
22 | 6 | return $this->max_selected_items; |
|
23 | } |
||
24 | |||
25 | /** |
||
26 | * Set the maximum number of selected items. |
||
27 | * |
||
28 | * @param int $maxSelectedItems |
||
29 | * |
||
30 | * @return $this |
||
31 | * |
||
32 | * @throws \InvalidArgumentException |
||
33 | */ |
||
34 | 8 | public function setMaxSelectedItems($maxSelectedItems) |
|
43 | } |
||
44 | } |
||
45 |