@@ -27,67 +27,67 @@ |
||
| 27 | 27 | abstract class AbstractConfig extends ArrayObject implements ConfigInterface |
| 28 | 28 | { |
| 29 | 29 | |
| 30 | - /** |
|
| 31 | - * Instantiate the AbstractConfig object. |
|
| 32 | - * |
|
| 33 | - * @since 0.1.0 |
|
| 34 | - * |
|
| 35 | - * @param array $config Array with settings. |
|
| 36 | - */ |
|
| 37 | - public function __construct(array $config) |
|
| 38 | - { |
|
| 39 | - // Make sure the config entries can be accessed as properties. |
|
| 40 | - parent::__construct($config, ArrayObject::ARRAY_AS_PROPS); |
|
| 41 | - } |
|
| 30 | + /** |
|
| 31 | + * Instantiate the AbstractConfig object. |
|
| 32 | + * |
|
| 33 | + * @since 0.1.0 |
|
| 34 | + * |
|
| 35 | + * @param array $config Array with settings. |
|
| 36 | + */ |
|
| 37 | + public function __construct(array $config) |
|
| 38 | + { |
|
| 39 | + // Make sure the config entries can be accessed as properties. |
|
| 40 | + parent::__construct($config, ArrayObject::ARRAY_AS_PROPS); |
|
| 41 | + } |
|
| 42 | 42 | |
| 43 | - /** |
|
| 44 | - * Check whether the Config has a specific key. |
|
| 45 | - * |
|
| 46 | - * @since 0.1.0 |
|
| 47 | - * |
|
| 48 | - * @param string $key The key to check the existence for. |
|
| 49 | - * @return bool |
|
| 50 | - */ |
|
| 51 | - public function hasKey($key) |
|
| 52 | - { |
|
| 53 | - return array_key_exists($key, (array)$this); |
|
| 54 | - } |
|
| 43 | + /** |
|
| 44 | + * Check whether the Config has a specific key. |
|
| 45 | + * |
|
| 46 | + * @since 0.1.0 |
|
| 47 | + * |
|
| 48 | + * @param string $key The key to check the existence for. |
|
| 49 | + * @return bool |
|
| 50 | + */ |
|
| 51 | + public function hasKey($key) |
|
| 52 | + { |
|
| 53 | + return array_key_exists($key, (array)$this); |
|
| 54 | + } |
|
| 55 | 55 | |
| 56 | - /** |
|
| 57 | - * Get the value of a specific key. |
|
| 58 | - * |
|
| 59 | - * @since 0.1.0 |
|
| 60 | - * |
|
| 61 | - * @param string $key The key to get the value for. |
|
| 62 | - * @return mixed |
|
| 63 | - * @throws OutOfRangeException If an unknown key is requested. |
|
| 64 | - */ |
|
| 65 | - public function getKey($key) |
|
| 66 | - { |
|
| 67 | - if ( ! $this->hasKey($key)) { |
|
| 68 | - throw new OutOfRangeException(sprintf(_('The configuration key %1$s does not exist.'), |
|
| 69 | - (string)$key)); |
|
| 70 | - } |
|
| 56 | + /** |
|
| 57 | + * Get the value of a specific key. |
|
| 58 | + * |
|
| 59 | + * @since 0.1.0 |
|
| 60 | + * |
|
| 61 | + * @param string $key The key to get the value for. |
|
| 62 | + * @return mixed |
|
| 63 | + * @throws OutOfRangeException If an unknown key is requested. |
|
| 64 | + */ |
|
| 65 | + public function getKey($key) |
|
| 66 | + { |
|
| 67 | + if ( ! $this->hasKey($key)) { |
|
| 68 | + throw new OutOfRangeException(sprintf(_('The configuration key %1$s does not exist.'), |
|
| 69 | + (string)$key)); |
|
| 70 | + } |
|
| 71 | 71 | |
| 72 | - return $this[$key]; |
|
| 73 | - } |
|
| 72 | + return $this[$key]; |
|
| 73 | + } |
|
| 74 | 74 | |
| 75 | - /** |
|
| 76 | - * Get the an array with all the keys |
|
| 77 | - * |
|
| 78 | - * @since 0.1.0 |
|
| 79 | - * @return array |
|
| 80 | - */ |
|
| 81 | - public function getKeys() |
|
| 82 | - { |
|
| 83 | - return array_keys((array)$this); |
|
| 84 | - } |
|
| 75 | + /** |
|
| 76 | + * Get the an array with all the keys |
|
| 77 | + * |
|
| 78 | + * @since 0.1.0 |
|
| 79 | + * @return array |
|
| 80 | + */ |
|
| 81 | + public function getKeys() |
|
| 82 | + { |
|
| 83 | + return array_keys((array)$this); |
|
| 84 | + } |
|
| 85 | 85 | |
| 86 | - /** |
|
| 87 | - * Validate the Config file. |
|
| 88 | - * |
|
| 89 | - * @since 0.1.0 |
|
| 90 | - * @return boolean |
|
| 91 | - */ |
|
| 92 | - abstract public function isValid(); |
|
| 86 | + /** |
|
| 87 | + * Validate the Config file. |
|
| 88 | + * |
|
| 89 | + * @since 0.1.0 |
|
| 90 | + * @return boolean |
|
| 91 | + */ |
|
| 92 | + abstract public function isValid(); |
|
| 93 | 93 | } |