Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitrii-fediuk committed Jun 2, 2024
1 parent 8d73d07 commit a5ba5dd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
14 changes: 1 addition & 13 deletions Core/lib/array/other.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,4 @@ function df_array($v):array {return is_array($v) ? $v : [$v];}
* @param string|int|int[]|string[] ...$a
* @return array(int|string => int|string)
*/
function dfa_combine_self(...$a):array {$a = df_args($a); return array_combine($a, $a);}

/**
* Алгоритм взят отсюда: https://php.net/manual/function.array-unshift.php#106570
* 2022-10-31 @deprecated It is unused.
* @param array(string => mixed) $a
* @param mixed $v
*/
function dfa_unshift_assoc(&$a, string $k, $v):void {
$a = array_reverse($a, true);
$a[$k] = $v;
$a = array_reverse($a, true);
}
function dfa_combine_self(...$a):array {$a = df_args($a); return array_combine($a, $a);}
12 changes: 12 additions & 0 deletions Core/lib/array/other/unshift_assoc.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php
/**
* Алгоритм взят отсюда: https://php.net/manual/function.array-unshift.php#106570
* 2022-10-31 @deprecated It is unused.
* @param array(string => mixed) $a
* @param mixed $v
*/
function dfa_unshift_assoc(&$a, string $k, $v):void {
$a = array_reverse($a, true);
$a[$k] = $v;
$a = array_reverse($a, true);
}

0 comments on commit a5ba5dd

Please sign in to comment.