| 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) |
||
| 40 | |||
| 41 | |||
| 42 | /** |
||
| 43 | * Force a boolean result from a particular parameter key |
||
| 44 | * |
||
| 45 | * @param mixed[string] $params |
||
|
1 ignored issue
–
show
|
|||
| 46 | * @param string $key [description] |
||
| 47 | * @return boolean `TRUE` iff `$params[$key]` exists and has a true value |
||
| 48 | * (`1`, `'yes'`, `'true'`, `true`, etc.), `FALSE` |
||
| 49 | * otherwise. |
||
| 50 | */ |
||
| 51 | protected function forceBooleanParameter($params, $key) |
||
| 55 | } |
||
| 56 |
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.