| 1 | <?php |
||
| 11 | class ApplicationConfigurationStorage |
||
| 12 | { |
||
| 13 | /** |
||
| 14 | * @var ApplicationConfiguration |
||
| 15 | */ |
||
| 16 | private $configuration; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * @var bool |
||
| 20 | */ |
||
| 21 | private $frozen = false; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * ApplicationConfigurationStorage constructor. |
||
| 25 | * |
||
| 26 | * Define the application configuration. Once the configuration is defined, it can not be defined anymore. An |
||
| 27 | * exception will be thrown if the set method is called a second time. |
||
| 28 | * |
||
| 29 | * @param array $configuration |
||
| 30 | */ |
||
| 31 | public function __construct(array $configuration = []) |
||
| 42 | |||
| 43 | /** |
||
| 44 | * Return the application configuration. If the none is defined yet, an exception will be thrown. |
||
| 45 | * |
||
| 46 | * @return ApplicationConfiguration |
||
| 47 | * |
||
| 48 | * @throws Exception |
||
| 49 | */ |
||
| 50 | public function getApplicationConfiguration() |
||
| 58 | |||
| 59 | /** |
||
| 60 | * Return true is the configuration is defined and the storage frozen. |
||
| 61 | * |
||
| 62 | * @return bool |
||
| 63 | */ |
||
| 64 | public function isFrozen() |
||
| 68 | } |
||
| 69 |