1 | <?php |
||
12 | trait RequireParameter |
||
13 | { |
||
14 | /** |
||
15 | * Require that a specific parameter key exists (and optionally has a |
||
16 | * particular class as one of its parents) |
||
17 | * |
||
18 | * @param mixed[string] $params |
||
1 ignored issue
–
show
|
|||
19 | * @param string $key |
||
20 | * @param string|false $class (Optional, defaults to `FALSE`) name of class |
||
21 | * to require as a parent |
||
22 | * @return void |
||
23 | * @throws Exception If the required parameter is not set (or does not |
||
24 | * have the correct parent class, if `$class` is specified) |
||
25 | */ |
||
26 | protected function requireParameter($params, $key, $class = false) |
||
41 | |||
42 | |||
43 | /** |
||
44 | * Force a boolean result from a particular parameter key |
||
45 | * |
||
46 | * @param mixed[string] $params |
||
1 ignored issue
–
show
|
|||
47 | * @param string $key [description] |
||
48 | * @return boolean `TRUE` iff `$params[$key]` exists and has a true value |
||
49 | * (`1`, `'yes'`, `'true'`, `true`, etc.), `FALSE` |
||
50 | * otherwise. |
||
51 | */ |
||
52 | protected function forceBooleanParameter($params, $key) |
||
56 | |||
57 | /** |
||
58 | * Set a parameter to a default value if it is not set |
||
59 | * |
||
60 | * @param mixed[string] $params |
||
1 ignored issue
–
show
|
|||
61 | * @param string $key |
||
62 | * @param mixed $value |
||
63 | * @param string|false $class |
||
64 | * @return void |
||
65 | */ |
||
66 | protected function defaultParameter(&$params, $key, $value, $class = false) |
||
74 | } |
||
75 |
This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.