Skip to content

Commit 5fa18de

Browse files
committed
FEATURE: array_combine is now deprecated
1 parent dc50e64 commit 5fa18de

File tree

5 files changed

+25
-26
lines changed

5 files changed

+25
-26
lines changed

deprecated/array.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,3 +202,27 @@ function usort(array &$array, callable $value_compare_func): void
202202
throw ArrayException::createFromPhpError();
203203
}
204204
}
205+
206+
/**
207+
* Creates an array by using the values from the
208+
* keys array as keys and the values from the
209+
* values array as the corresponding values.
210+
*
211+
* @param array $keys Array of keys to be used. Illegal values for key will be
212+
* converted to string.
213+
* @param array $values Array of values to be used
214+
* @return array Returns the combined array, FALSE if the number of elements
215+
* for each array isn't equal.
216+
* @throws ArrayException
217+
* @deprecated
218+
*
219+
*/
220+
function array_combine(array $keys, array $values): array
221+
{
222+
error_clear_last();
223+
$result = \array_combine($keys, $values);
224+
if ($result === false) {
225+
throw ArrayException::createFromPhpError();
226+
}
227+
return $result;
228+
}

deprecated/functionsList.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
'apc_load_constants',
1313
'apc_sma_info',
1414
'arsort',
15+
'array_combine',
1516
'array_flip',
1617
'asort',
1718
'event_add',

generated/array.php

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,6 @@
44

55
use Safe\Exceptions\ArrayException;
66

7-
/**
8-
* Creates an array by using the values from the
9-
* keys array as keys and the values from the
10-
* values array as the corresponding values.
11-
*
12-
* @param array $keys Array of keys to be used. Illegal values for key will be
13-
* converted to string.
14-
* @param array $values Array of values to be used
15-
* @return array Returns the combined array, FALSE if the number of elements
16-
* for each array isn't equal.
17-
* @throws ArrayException
18-
*
19-
*/
20-
function array_combine(array $keys, array $values): array
21-
{
22-
error_clear_last();
23-
$result = \array_combine($keys, $values);
24-
if ($result === false) {
25-
throw ArrayException::createFromPhpError();
26-
}
27-
return $result;
28-
}
29-
30-
317
/**
328
* array_replace_recursive replaces the values of
339
* array with the same values from all the following

generated/functionsList.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
'apcu_inc',
1515
'apcu_sma_info',
1616
'apc_fetch',
17-
'array_combine',
1817
'array_replace',
1918
'array_replace_recursive',
2019
'array_walk_recursive',

rector-migrate.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
'apcu_inc' => 'Safe\apcu_inc',
2525
'apcu_sma_info' => 'Safe\apcu_sma_info',
2626
'apc_fetch' => 'Safe\apc_fetch',
27-
'array_combine' => 'Safe\array_combine',
2827
'array_replace' => 'Safe\array_replace',
2928
'array_replace_recursive' => 'Safe\array_replace_recursive',
3029
'array_walk_recursive' => 'Safe\array_walk_recursive',

0 commit comments

Comments
 (0)