diff --git a/generated/array.php b/generated/array.php index b1b1a320..4a6b844f 100644 --- a/generated/array.php +++ b/generated/array.php @@ -102,42 +102,6 @@ function array_multisort(array &$array1, $array1_sort_order = SORT_ASC, $array1_ } -/** - * Searches haystack for needle. - * - * @param mixed $needle The searched value. - * - * If needle is a string, the comparison is done - * in a case-sensitive manner. - * @param array $haystack The array. - * @param bool $strict If the third parameter strict is set to TRUE - * then the array_search function will search for - * identical elements in the - * haystack. This means it will also perform a - * strict type comparison of the - * needle in the haystack, - * and objects must be the same instance. - * @return int|string Returns the key for needle if it is found in the - * array, FALSE otherwise. - * - * If needle is found in haystack - * more than once, the first matching key is returned. To return the keys for - * all matching values, use array_keys with the optional - * search_value parameter instead. - * @throws ArrayException - * - */ -function array_search($needle, array $haystack, bool $strict = false) -{ - error_clear_last(); - $result = \array_search($needle, $haystack, $strict); - if ($result === false) { - throw ArrayException::createFromPhpError(); - } - return $result; -} - - /** * Applies the user-defined callback function to each * element of the array. This function will recurse diff --git a/generated/functionsList.php b/generated/functionsList.php index 1a19ca79..bd23485b 100644 --- a/generated/functionsList.php +++ b/generated/functionsList.php @@ -27,7 +27,6 @@ 'apcu_sma_info', 'array_combine', 'array_multisort', - 'array_search', 'array_walk_recursive', 'arsort', 'asort', @@ -451,7 +450,6 @@ 'mailparse_msg_parse_file', 'mailparse_msg_parse', 'mailparse_stream_encode', - 'mb_check_encoding', 'mb_chr', 'mb_detect_order', 'mb_encoding_aliases', diff --git a/generated/mbstring.php b/generated/mbstring.php index 4530b070..80c3bf7c 100644 --- a/generated/mbstring.php +++ b/generated/mbstring.php @@ -4,30 +4,6 @@ use Safe\Exceptions\MbstringException; -/** - * Checks if the specified byte stream is valid for the specified encoding. - * It is useful to prevent so-called "Invalid Encoding Attack". - * - * @param string $var The byte stream to check. If it is omitted, this function checks - * all the input from the beginning of the request. - * @param string $encoding The expected encoding. - * @throws MbstringException - * - */ -function mb_check_encoding(string $var = null, string $encoding = null): void -{ - error_clear_last(); - if ($encoding !== null) { - $result = \mb_check_encoding($var, $encoding); - } else { - $result = \mb_check_encoding($var); - } - if ($result === false) { - throw MbstringException::createFromPhpError(); - } -} - - /** * * diff --git a/generator/config/ignoredFunctions.php b/generator/config/ignoredFunctions.php index b9d4cbdb..624ded8f 100644 --- a/generator/config/ignoredFunctions.php +++ b/generator/config/ignoredFunctions.php @@ -10,4 +10,6 @@ 'func_get_arg', //'mktime', // 7th parameter has been removed in PHP 7 'call_user_func_array', + 'mb_check_encoding', + 'array_search', ]; \ No newline at end of file diff --git a/rector-migrate.yml b/rector-migrate.yml index 05c62fb5..24e6ed4c 100644 --- a/rector-migrate.yml +++ b/rector-migrate.yml @@ -28,7 +28,6 @@ services: apcu_sma_info: 'Safe\apcu_sma_info' array_combine: 'Safe\array_combine' array_multisort: 'Safe\array_multisort' - array_search: 'Safe\array_search' array_walk_recursive: 'Safe\array_walk_recursive' arsort: 'Safe\arsort' asort: 'Safe\asort' @@ -452,7 +451,6 @@ services: mailparse_msg_parse_file: 'Safe\mailparse_msg_parse_file' mailparse_msg_parse: 'Safe\mailparse_msg_parse' mailparse_stream_encode: 'Safe\mailparse_stream_encode' - mb_check_encoding: 'Safe\mb_check_encoding' mb_chr: 'Safe\mb_chr' mb_detect_order: 'Safe\mb_detect_order' mb_encoding_aliases: 'Safe\mb_encoding_aliases'