@@ -48,11 +48,11 @@ public static function get(array $arr, $key, $default = NULL)
4848 * @return mixed
4949 * @throws Nette\InvalidArgumentException if traversed item is not an array
5050 */
51- public static function & getRef (array & $ arr , $ key )
51+ public static function &getRef (array &$ arr , $ key )
5252 {
5353 foreach (is_array ($ key ) ? $ key : [$ key ] as $ k ) {
5454 if (is_array ($ arr ) || $ arr === NULL ) {
55- $ arr = & $ arr [$ k ];
55+ $ arr = &$ arr [$ k ];
5656 } else {
5757 throw new Nette \InvalidArgumentException ('Traversed item is not an array. ' );
5858 }
@@ -92,7 +92,7 @@ public static function searchKey(array $arr, $key)
9292 * Inserts new array before item specified by key.
9393 * @return void
9494 */
95- public static function insertBefore (array & $ arr , $ key , array $ inserted )
95+ public static function insertBefore (array &$ arr , $ key , array $ inserted )
9696 {
9797 $ offset = (int ) self ::searchKey ($ arr , $ key );
9898 $ arr = array_slice ($ arr , 0 , $ offset , TRUE ) + $ inserted + array_slice ($ arr , $ offset , count ($ arr ), TRUE );
@@ -103,7 +103,7 @@ public static function insertBefore(array & $arr, $key, array $inserted)
103103 * Inserts new array after item specified by key.
104104 * @return void
105105 */
106- public static function insertAfter (array & $ arr , $ key , array $ inserted )
106+ public static function insertAfter (array &$ arr , $ key , array $ inserted )
107107 {
108108 $ offset = self ::searchKey ($ arr , $ key );
109109 $ offset = $ offset === FALSE ? count ($ arr ) : $ offset + 1 ;
@@ -115,7 +115,7 @@ public static function insertAfter(array & $arr, $key, array $inserted)
115115 * Renames key in array.
116116 * @return void
117117 */
118- public static function renameKey (array & $ arr , $ oldKey , $ newKey )
118+ public static function renameKey (array &$ arr , $ oldKey , $ newKey )
119119 {
120120 $ offset = self ::searchKey ($ arr , $ oldKey );
121121 if ($ offset !== FALSE ) {
@@ -144,8 +144,8 @@ public static function flatten(array $arr, $preserveKeys = FALSE)
144144 {
145145 $ res = [];
146146 $ cb = $ preserveKeys
147- ? function ($ v , $ k ) use (& $ res ) { $ res [$ k ] = $ v ; }
148- : function ($ v ) use (& $ res ) { $ res [] = $ v ; };
147+ ? function ($ v , $ k ) use (&$ res ) { $ res [$ k ] = $ v ; }
148+ : function ($ v ) use (&$ res ) { $ res [] = $ v ; };
149149 array_walk_recursive ($ arr , $ cb );
150150 return $ res ;
151151 }
@@ -179,12 +179,12 @@ public static function associate(array $arr, $path)
179179
180180 foreach ($ arr as $ rowOrig ) {
181181 $ row = (array ) $ rowOrig ;
182- $ x = & $ res ;
182+ $ x = &$ res ;
183183
184184 for ($ i = 0 ; $ i < count ($ parts ); $ i ++) {
185185 $ part = $ parts [$ i ];
186186 if ($ part === '[] ' ) {
187- $ x = & $ x [];
187+ $ x = &$ x [];
188188
189189 } elseif ($ part === '= ' ) {
190190 if (isset ($ parts [++$ i ])) {
@@ -194,13 +194,13 @@ public static function associate(array $arr, $path)
194194
195195 } elseif ($ part === '-> ' ) {
196196 if (isset ($ parts [++$ i ])) {
197- $ x = & $ x ->{$ row [$ parts [$ i ]]};
197+ $ x = &$ x ->{$ row [$ parts [$ i ]]};
198198 } else {
199199 $ row = is_object ($ rowOrig ) ? $ rowOrig : (object ) $ row ;
200200 }
201201
202202 } elseif ($ part !== '| ' ) {
203- $ x = & $ x [(string ) $ row [$ part ]];
203+ $ x = &$ x [(string ) $ row [$ part ]];
204204 }
205205 }
206206
@@ -235,7 +235,7 @@ public static function normalize(array $arr, $filling = NULL)
235235 * @return mixed
236236 * @throws Nette\InvalidArgumentException if item does not exist and default value is not provided
237237 */
238- public static function pick (array & $ arr , $ key , $ default = NULL )
238+ public static function pick (array &$ arr , $ key , $ default = NULL )
239239 {
240240 if (array_key_exists ($ key , $ arr )) {
241241 $ value = $ arr [$ key ];
0 commit comments