Lines
100.00%
10 / 10
Methods
100.00%
1 / 1
Classes
100.00%
1 / 1
| Name | Lines | Methods | CRAP | ||||
|---|---|---|---|---|---|---|---|
| permOptions | 100.00% | 10 / 10 | 100.00% | 1 / 1 | 3 | ||
| 27 | class PermissionHelper | |
| 28 | { | |
| 29 | /** | |
| 30 | * Renders a select box for permission types. | |
| 31 | * | |
| 32 | * @param string $current Selected option | |
| 33 | */ | |
| 34 | public static function permOptions(string $current): string | |
| 35 | { | |
| 36 | $options = ['basic', 'medium']; | |
| 37 | $output = ''; | |
| 38 | ||
| 39 | foreach ($options as $option) { | |
| 40 | $output .= sprintf( | |
| 41 | '<option value="%s" %s>%s</option>', | |
| 42 | $option, | |
| 43 | $option === $current ? 'selected' : '', | |
| 44 | $option, | |
| 45 | ); | |
| 46 | } | |
| 47 | ||
| 48 | return $output; | |
| 49 | } | |
| 50 | } |