| 1 | <?php |
||
| 19 | class Config extends ArrayObject implements ConfigInterface |
||
|
1 ignored issue
–
show
|
|||
| 20 | { |
||
| 21 | |||
| 22 | /** |
||
| 23 | * Instantiate the Config object. |
||
| 24 | * |
||
| 25 | * @since 0.1.0 |
||
| 26 | * |
||
| 27 | * @param array $config Array with settings. |
||
| 28 | */ |
||
| 29 | public function __construct(array $config) |
||
| 34 | |||
| 35 | /** |
||
| 36 | * Magic method that enables the use of normal array_* functions on the |
||
| 37 | * Config object. |
||
| 38 | * |
||
| 39 | * @since 0.1.0 |
||
| 40 | * |
||
| 41 | * @param string $function The function that was called on this object. |
||
| 42 | * @param mixed $arguments The arguments that were used for the function |
||
| 43 | * call. |
||
| 44 | * @return mixed |
||
| 45 | * @throws BadMethodCallException |
||
| 46 | */ |
||
| 47 | public function __call($function, $arguments) |
||
| 55 | |||
| 56 | /** |
||
| 57 | * Check whether the Config has a specific key. |
||
| 58 | * |
||
| 59 | * @since 0.1.0 |
||
| 60 | * |
||
| 61 | * @param string $key The key to check the existence for. |
||
| 62 | * @return bool |
||
| 63 | */ |
||
| 64 | public function hasKey($key) |
||
| 68 | |||
| 69 | /** |
||
| 70 | * Get the value of a specific key. |
||
| 71 | * |
||
| 72 | * @since 0.1.0 |
||
| 73 | * |
||
| 74 | * @param string $key The key to get the value for. |
||
| 75 | * @return mixed |
||
| 76 | */ |
||
| 77 | public function getKey($key) |
||
| 81 | |||
| 82 | /** |
||
| 83 | * Get the an array with all the keys |
||
| 84 | * |
||
| 85 | * @since 0.1.0 |
||
| 86 | * @return mixed |
||
| 87 | */ |
||
| 88 | public function getKeys() |
||
| 92 | } |
||
| 93 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.