2727 * - boolean is a wrong type for the key; do not use a boolean key (it's juggled into a string)
2828 *
2929 * Use string values for the keys and you'll be golden.
30+ *
31+ * @property array $data
3032 */
3133class ExtendedArguments extends Arguments
3234{
@@ -37,16 +39,16 @@ public function get(string $index, mixed $default = null): mixed
3739
3840 public function set (mixed $ index , mixed $ value ): static
3941 {
40- $ storage = & $ this ->storage ;
42+ $ data =& $ this ->data ;
4143 foreach (explode ('. ' , $ index ) as $ i ) {
42- if (false === is_array ($ storage [$ i ]) ||
43- false === array_key_exists ($ i , $ storage )
44+ if (false === is_array ($ data [$ i ]) ||
45+ false === array_key_exists ($ i , $ data )
4446 ) {
45- $ storage [$ i ] = [];
47+ $ data [$ i ] = [];
4648 }
47- $ storage = & $ storage [$ i ];
49+ $ data =& $ data [$ i ];
4850 }
49- $ storage = $ value ;
51+ $ data = $ value ;
5052 return $ this ;
5153 }
5254
@@ -60,31 +62,31 @@ public function append(string $index, mixed $value): static
6062
6163 public function has (string $ index ): bool
6264 {
63- $ storage = & $ this ->storage ;
65+ $ data = & $ this ->data ;
6466 foreach (explode ('. ' , $ index ) as $ i ) {
65- if (false === is_array ($ storage ) ||
66- false === array_key_exists ($ i , $ storage )
67+ if (false === is_array ($ data ) ||
68+ false === array_key_exists ($ i , $ data )
6769 ) {
6870 return false ;
6971 }
70- $ storage = & $ storage [$ i ];
72+ $ data =& $ data [$ i ];
7173 }
7274 return true ;
7375 }
7476
7577 public function delete (string $ index ): static
7678 {
77- $ storage = & $ this ->storage ;
79+ $ data =& $ this ->data ;
7880 foreach (explode ('. ' , $ index ) as $ i ) {
79- if (false === is_array ($ storage [$ i ]) ||
80- false === array_key_exists ($ i , $ storage )
81+ if (false === is_array ($ data [$ i ]) ||
82+ false === array_key_exists ($ i , $ data )
8183 ) {
8284 continue ;
8385 }
84- $ storage = & $ storage [$ i ];
86+ $ data =& $ data [$ i ];
8587 }
8688 if (isset ($ i )) {
87- unset($ storage [$ i ]);
89+ unset($ data [$ i ]);
8890 }
8991 return $ this ;
9092 }
@@ -103,7 +105,7 @@ public function flatten(): static
103105 $ indexes = [];
104106 $ flatten = [];
105107 $ iterator = new RecursiveIteratorIterator (
106- new RecursiveArrayIterator ($ this ->storage ),
108+ new RecursiveArrayIterator ($ this ->data ),
107109 RecursiveIteratorIterator::SELF_FIRST
108110 );
109111 foreach ($ iterator as $ index => $ value ) {
0 commit comments