@@ -136,7 +136,7 @@ public static function last(array $array)
136136 */
137137 public static function insertBefore (array &$ array , $ key , array $ inserted ): void
138138 {
139- $ offset = (int ) self ::searchKey ($ array , $ key );
139+ $ offset = (int ) self ::getKeyOffset ($ array , $ key );
140140 $ array = array_slice ($ array , 0 , $ offset , true )
141141 + $ inserted
142142 + array_slice ($ array , $ offset , count ($ array ), true );
@@ -150,7 +150,7 @@ public static function insertBefore(array &$array, $key, array $inserted): void
150150 */
151151 public static function insertAfter (array &$ array , $ key , array $ inserted ): void
152152 {
153- $ offset = self ::searchKey ($ array , $ key );
153+ $ offset = self ::getKeyOffset ($ array , $ key );
154154 $ offset = $ offset === null ? count ($ array ) : $ offset + 1 ;
155155 $ array = array_slice ($ array , 0 , $ offset , true )
156156 + $ inserted
@@ -165,7 +165,7 @@ public static function insertAfter(array &$array, $key, array $inserted): void
165165 */
166166 public static function renameKey (array &$ array , $ oldKey , $ newKey ): bool
167167 {
168- $ offset = self ::searchKey ($ array , $ oldKey );
168+ $ offset = self ::getKeyOffset ($ array , $ oldKey );
169169 if ($ offset === null ) {
170170 return false ;
171171 }
0 commit comments