22
33namespace Phaseolies \Http ;
44
5- /**
6- * Class InputBag
7- *
8- * A simple container for managing input data (e.g., query parameters, form data).
9- * Provides methods to retrieve, set, check, and replace input data.
10- */
115class InputBag
126{
137 /**
@@ -18,7 +12,7 @@ class InputBag
1812 /**
1913 * InputBag constructor.
2014 *
21- * @param array $data Initial data to populate the bag.
15+ * @param array $data
2216 */
2317 public function __construct (array $ data = [])
2418 {
@@ -28,9 +22,9 @@ public function __construct(array $data = [])
2822 /**
2923 * Retrieves the value for a given key from the input data.
3024 *
31- * @param string $key The key to retrieve.
32- * @param mixed $default The default value to return if the key does not exist.
33- * @return mixed The value associated with the key, or the default value if the key is not found.
25+ * @param string $key
26+ * @param mixed $default
27+ * @return mixed
3428 */
3529 public function get (string $ key , mixed $ default = null ): mixed
3630 {
@@ -40,8 +34,9 @@ public function get(string $key, mixed $default = null): mixed
4034 /**
4135 * Sets a value for a given key in the input data.
4236 *
43- * @param string $key The key to set.
44- * @param mixed $value The value to associate with the key.
37+ * @param string $key
38+ * @param mixed $value
39+ * @return void
4540 */
4641 public function set (string $ key , mixed $ value ): void
4742 {
@@ -51,8 +46,8 @@ public function set(string $key, mixed $value): void
5146 /**
5247 * Checks if a key exists in the input data.
5348 *
54- * @param string $key The key to check.
55- * @return bool True if the key exists, false otherwise.
49+ * @param string $key
50+ * @return bool
5651 */
5752 public function has (string $ key ): bool
5853 {
@@ -62,7 +57,7 @@ public function has(string $key): bool
6257 /**
6358 * Retrieves all input data as an associative array.
6459 *
65- * @return array The entire input data.
60+ * @return array
6661 */
6762 public function all (): array
6863 {
@@ -72,7 +67,8 @@ public function all(): array
7267 /**
7368 * Replaces the entire input data with a new set of data.
7469 *
75- * @param array $data The new data to replace the existing input data.
70+ * @param array $data
71+ * @return void
7672 */
7773 public function replace (array $ data ): void
7874 {
0 commit comments