11<?php
2- /**
3- * @copyright Copyright (c) Ares (https://www.ares.to)
4- *
5- * @see LICENSE (MIT)
6- */
72
83namespace Ares \Framework ;
94
@@ -35,8 +30,7 @@ class Config implements ConfigInterface, ArrayAccess, IteratorAggregate
3530 * @param mixed $context Raw array of configuration options or path to a
3631 * configuration file or directory containing one or
3732 * more configuration files
38- * @param string|null $prefix A key under which the loaded config will be nested
39- * @throws InvalidContextException
33+ * @param string $prefix A key under which the loaded config will be nested
4034 */
4135 public function __construct ($ context = null , string $ prefix = null )
4236 {
@@ -61,7 +55,7 @@ public function __construct($context = null, string $prefix = null)
6155 *
6256 * @param string $path A path to a directory of configuration files
6357 *
64- * @return ConfigInterface A new ConfigInterface object
58+ * @return \Ares\Framework\Interfaces\ ConfigInterface A new ConfigInterface object
6559 */
6660 public static function fromDirectory (string $ path ): ConfigInterface
6761 {
@@ -87,7 +81,7 @@ public static function fromDirectory(string $path): ConfigInterface
8781 *
8882 * @return bool True on success, otherwise false
8983 */
90- public function set (string $ key , mixed $ value ): bool
84+ public function set (string $ key , $ value ): bool
9185 {
9286 $ config = &$ this ->config ;
9387
@@ -104,11 +98,11 @@ public function set(string $key, mixed $value): bool
10498 * Retrieve a configuration option via a provided key.
10599 *
106100 * @param string $key Unique configuration option key
107- * @param mixed|null $default Default value to return if option does not exist
101+ * @param mixed $default Default value to return if option does not exist
108102 *
109103 * @return mixed Stored config item or $default value
110104 */
111- public function get (string $ key , mixed $ default = null ): mixed
105+ public function get (string $ key , $ default = null )
112106 {
113107 $ config = $ this ->config ;
114108
@@ -149,11 +143,11 @@ public function has(string $key): bool
149143 * @param string $key Unique configuration option key
150144 * @param mixed $value Config item value
151145 *
152- * @return true
153- *@throws RuntimeException
146+ * @throws RuntimeException
154147 *
148+ * @return true
155149 */
156- public function append (string $ key , mixed $ value ): bool
150+ public function append (string $ key , $ value ): bool
157151 {
158152 $ config = &$ this ->config ;
159153
@@ -176,11 +170,11 @@ public function append(string $key, mixed $value): bool
176170 * @param string $key Unique configuration option key
177171 * @param mixed $value Config item value
178172 *
179- * @return true
180- *@throws RuntimeException
173+ * @throws RuntimeException
181174 *
175+ * @return true
182176 */
183- public function prepend (string $ key , mixed $ value ): bool
177+ public function prepend (string $ key , $ value ): bool
184178 {
185179 $ config = &$ this ->config ;
186180
@@ -217,11 +211,11 @@ public function unset(string $key): bool
217211 * Load configuration options from a file or directory.
218212 *
219213 * @param string $path Path to configuration file or directory
220- * @param string|null $prefix A key under which the loaded config will be nested
214+ * @param string $prefix A key under which the loaded config will be nested
221215 * @param bool $override Whether or not to override existing options with
222216 * values from the loaded file
223217 *
224- * @return ConfigInterface This Config object
218+ * @return \Ares\Framework\Interfaces\ ConfigInterface This Config object
225219 */
226220 public function load (string $ path , string $ prefix = null , bool $ override = true ): ConfigInterface
227221 {
@@ -246,11 +240,11 @@ public function load(string $path, string $prefix = null, bool $override = true)
246240 /**
247241 * Merge another Config object into this one.
248242 *
249- * @param ConfigInterface $config Instance of Config
243+ * @param \Ares\Framework\Interfaces\ ConfigInterface $config Instance of Config
250244 * @param bool $override Whether or not to override existing options with
251245 * values from the merged config object
252246 *
253- * @return ConfigInterface This Config object
247+ * @return \Ares\Framework\Interfaces\ ConfigInterface This Config object
254248 */
255249 public function merge (ConfigInterface $ config , bool $ override = true ): ConfigInterface
256250 {
@@ -268,8 +262,7 @@ public function merge(ConfigInterface $config, bool $override = true): ConfigInt
268262 *
269263 * @param string $key Unique configuration option key
270264 *
271- * @return ConfigInterface A new ConfigInterface object
272- * @throws InvalidContextException
265+ * @return \Ares\Framework\Interfaces\ConfigInterface A new ConfigInterface object
273266 */
274267 public function split (string $ key ): ConfigInterface
275268 {
0 commit comments