| 1 | <?php declare(strict_types=1); |
||
| 10 | trait ConfigurationAccessor |
||
| 11 | { |
||
| 12 | /** |
||
| 13 | * @var Configuration |
||
| 14 | */ |
||
| 15 | private $config; |
||
| 16 | |||
| 17 | 11 | public function getConfig(): Configuration |
|
| 21 | |||
| 22 | /** |
||
| 23 | * Get configuration options |
||
| 24 | * |
||
| 25 | * @param mixed $default |
||
| 26 | * @return mixed |
||
| 27 | */ |
||
| 28 | 20 | public function get(string $name, $default = null) |
|
| 32 | |||
| 33 | /** |
||
| 34 | * Check configuration option |
||
| 35 | */ |
||
| 36 | 19 | public function has(string $name): bool |
|
| 40 | |||
| 41 | /** |
||
| 42 | * Set configuration option |
||
| 43 | * |
||
| 44 | * @param mixed $value |
||
| 45 | * @return static |
||
| 46 | */ |
||
| 47 | 17 | public function set(string $name, $value) |
|
| 52 | |||
| 53 | /** |
||
| 54 | * Add configuration option |
||
| 55 | * |
||
| 56 | * @param mixed[] $value |
||
| 57 | * @return static |
||
| 58 | */ |
||
| 59 | 1 | public function add(string $name, array $value) |
|
| 64 | } |
||
| 65 |