1 | <?php |
||
5 | trait OptionsTrait /* implements OptionsInterface */ |
||
6 | { |
||
7 | /** |
||
8 | * Check that all required options are defined, then hydrate. |
||
9 | * |
||
10 | * @param array $values |
||
11 | */ |
||
12 | 5 | public function __construct(array $values) |
|
26 | |||
27 | /** |
||
28 | * Provide read-only access to attributes. |
||
29 | * |
||
30 | * @param string $key |
||
31 | * |
||
32 | * @return mixed |
||
33 | */ |
||
34 | 2 | final public function __get($key) |
|
38 | |||
39 | /** |
||
40 | * Prevent modification. |
||
41 | * |
||
42 | * @throws ImmutableException |
||
43 | * |
||
44 | * @param string $key |
||
45 | * @param mixed $value |
||
46 | * |
||
47 | * @return void |
||
48 | */ |
||
49 | 1 | final public function __set($key, $value) |
|
53 | |||
54 | /** |
||
55 | * Prevent modification. |
||
56 | * |
||
57 | * @throws ImmutableException |
||
58 | * |
||
59 | * @param string $key |
||
60 | * |
||
61 | * @return void |
||
62 | */ |
||
63 | 1 | final public function __unset($key) |
|
67 | |||
68 | /** |
||
69 | * Ensure that all required options are included in the given values. |
||
70 | * |
||
71 | * @param array $values |
||
72 | * |
||
73 | * @return void |
||
74 | * |
||
75 | * @throws CommandException |
||
76 | * If any required options have not been defined. |
||
77 | */ |
||
78 | private function ensureRequired(array $values) |
||
90 | |||
91 | /** |
||
92 | * @inheritdoc |
||
93 | */ |
||
94 | 5 | public function valid() |
|
98 | |||
99 | /** |
||
100 | * @inheritdoc |
||
101 | */ |
||
102 | 5 | public function toArray() |
|
106 | } |
||
107 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.