Merge pull request #7612 from ping-yee/230624_mix_in_helpers

docs: Replace type `mixed` in all helper files.
This commit is contained in:
kenjis 2023-07-03 15:52:11 +09:00 committed by GitHub
commit 311d66ea89
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 16 additions and 20 deletions

View File

@ -155,11 +155,6 @@ parameters:
count: 1
path: system/Helpers/filesystem_helper.php
-
message: "#^Binary operation \"\\+\" between 0 and string results in an error\\.$#"
count: 1
path: system/Helpers/number_helper.php
-
message: "#^Property CodeIgniter\\\\Images\\\\Handlers\\\\BaseHandler\\:\\:\\$image \\(CodeIgniter\\\\Images\\\\Image\\) in empty\\(\\) is not falsy\\.$#"
count: 1

View File

@ -41,7 +41,7 @@ if (! function_exists('_array_search_dot')) {
*
* @internal This should not be used on its own.
*
* @return mixed
* @return array|bool|float|int|object|string|null
*/
function _array_search_dot(array $indexes, array $array)
{
@ -103,9 +103,9 @@ if (! function_exists('array_deep_search')) {
/**
* Returns the value of an element at a key in an array of uncertain depth.
*
* @param mixed $key
* @param int|string $key
*
* @return mixed|null
* @return array|bool|float|int|object|string|null
*/
function array_deep_search($key, array $array)
{

View File

@ -86,7 +86,7 @@ if (! function_exists('delete_cookie')) {
/**
* Delete a cookie
*
* @param mixed $name
* @param string $name
* @param string $domain the cookie domain. Usually: .yourdomain.com
* @param string $path the cookie path
* @param string $prefix the cookie prefix

View File

@ -292,8 +292,8 @@ if (! function_exists('get_file_info')) {
* Options are: name, server_path, size, date, readable, writable, executable, fileperms
* Returns false if the file cannot be found.
*
* @param string $file Path to file
* @param mixed $returnedValues Array or comma separated string of information returned
* @param string $file Path to file
* @param array|string $returnedValues Array or comma separated string of information returned
*
* @return array|null
*/

View File

@ -15,8 +15,8 @@ if (! function_exists('number_to_size')) {
/**
* Formats a numbers as bytes, based on size, and adds the appropriate suffix
*
* @param mixed $num Will be cast as int
* @param string $locale
* @param int|string $num Will be cast as int
* @param string $locale
*
* @return bool|string
*/
@ -69,7 +69,7 @@ if (! function_exists('number_to_amount')) {
*
* @see https://simple.wikipedia.org/wiki/Names_for_large_numbers
*
* @param string $num
* @param int|string $num
*
* @return bool|string
*/
@ -77,6 +77,7 @@ if (! function_exists('number_to_amount')) {
{
// Strip any formatting & ensure numeric input
try {
// @phpstan-ignore-next-line
$num = 0 + str_replace(',', '', $num);
} catch (ErrorException $ee) {
return false;

View File

@ -410,10 +410,10 @@ if (! function_exists('ellipsize')) {
*
* This function will strip tags from a string, split it at its max_length and ellipsize
*
* @param string $str String to ellipsize
* @param int $maxLength Max length of string
* @param mixed $position int (1|0) or float, .5, .2, etc for position to split
* @param string $ellipsis ellipsis ; Default '...'
* @param string $str String to ellipsize
* @param int $maxLength Max length of string
* @param float|int $position int (1|0) or float, .5, .2, etc for position to split
* @param string $ellipsis ellipsis ; Default '...'
*
* @return string Ellipsized string
*/
@ -446,9 +446,9 @@ if (! function_exists('strip_slashes')) {
*
* Removes slashes contained in a string or in an array
*
* @param mixed $str string or array
* @param array|string $str string or array
*
* @return mixed string or array
* @return array|string string or array
*/
function strip_slashes($str)
{