| 1 | <?php |
||
| 10 | class Options |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * @var array $option option's list |
||
| 14 | */ |
||
| 15 | protected $options = []; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * Constructor |
||
| 19 | * Merge default option with passed values |
||
| 20 | * |
||
| 21 | * @param array $defaultOptions Default options |
||
| 22 | * @param array $options Options from applications/users |
||
| 23 | */ |
||
| 24 | public function __construct($defaultOptions, $options) |
||
| 28 | |||
| 29 | /** |
||
| 30 | * Getter accessor to options property |
||
| 31 | * |
||
| 32 | * @return array |
||
| 33 | */ |
||
| 34 | public function getOptions() |
||
| 38 | |||
| 39 | /** |
||
| 40 | * Get the value for an option |
||
| 41 | * |
||
| 42 | * @param string $optionKey The option key |
||
| 43 | * |
||
| 44 | * @return mixed |
||
| 45 | * |
||
| 46 | * @throws Exception If the key not exists |
||
| 47 | */ |
||
| 48 | public function getValue($optionKey) |
||
| 56 | } |
||
| 57 |