diff --git a/system/Helpers/Array/ArrayHelper.php b/system/Helpers/Array/ArrayHelper.php index 1e7d6904796c..f70f6905ca5d 100644 --- a/system/Helpers/Array/ArrayHelper.php +++ b/system/Helpers/Array/ArrayHelper.php @@ -33,7 +33,8 @@ final class ArrayHelper * * @used-by dot_array_search() * - * @param string $index The index as dot array syntax. + * @param string $index The index as dot array syntax. + * @param array $array * * @return mixed */ @@ -68,6 +69,9 @@ private static function convertToArray(string $index): array * * @used-by dotSearch() * + * @param list $indexes + * @param array $array + * * @return mixed */ private static function arraySearchDot(array $indexes, array $array) @@ -125,6 +129,8 @@ private static function arraySearchDot(array $indexes, array $array) * array_key_exists() with dot array syntax. * * If wildcard `*` is used, all items for the key after it must have the key. + * + * @param array $array */ public static function dotKeyExists(string $index, array $array): bool { @@ -179,11 +185,11 @@ public static function dotKeyExists(string $index, array $array): bool * * @used-by array_group_by() * - * @param array $array Data array (i.e. from query result) - * @param array $indexes Indexes to group by. Dot syntax used. Returns $array if empty - * @param bool $includeEmpty If true, null and '' are also added as valid keys to group + * @param array $array Data array (i.e. from query result) + * @param list $indexes Indexes to group by. Dot syntax used. Returns $array if empty + * @param bool $includeEmpty If true, null and '' are also added as valid keys to group * - * @return array Result array where rows are grouped together by indexes values. + * @return array Result array where rows are grouped together by indexes values. */ public static function groupBy(array $array, array $indexes, bool $includeEmpty = false): array { @@ -205,6 +211,12 @@ public static function groupBy(array $array, array $indexes, bool $includeEmpty * `dot_array_search()`. * * @used-by groupBy() + * + * @param array $result + * @param array $row + * @param list $indexes + * + * @return array */ private static function arrayAttachIndexedValue( array $result, @@ -244,6 +256,11 @@ private static function arrayAttachIndexedValue( /** * Compare recursively two associative arrays and return difference as new array. * Returns keys that exist in `$original` but not in `$compareWith`. + * + * @param array $original + * @param array $compareWith + * + * @return array */ public static function recursiveDiff(array $original, array $compareWith): array { @@ -284,6 +301,8 @@ public static function recursiveDiff(array $original, array $compareWith): array /** * Recursively count all keys. + * + * @param array $array */ public static function recursiveCount(array $array, int $counter = 0): int { diff --git a/system/Helpers/array_helper.php b/system/Helpers/array_helper.php index 4d5d12488d78..f0ea0637c545 100644 --- a/system/Helpers/array_helper.php +++ b/system/Helpers/array_helper.php @@ -20,6 +20,8 @@ * Searches an array through dot syntax. Supports * wildcard searches, like foo.*.bar * + * @param array $array + * * @return mixed */ function dot_array_search(string $index, array $array) @@ -32,7 +34,8 @@ function dot_array_search(string $index, array $array) /** * Returns the value of an element at a key in an array of uncertain depth. * - * @param int|string $key + * @param int|string $key + * @param array $array * * @return mixed */ @@ -78,9 +81,9 @@ function array_deep_search($key, array $array) * For information on multi-level array sorting, refer to Example #3 here: * https://www.php.net/manual/de/function.array-multisort.php * - * @param array $array the reference of the array to be sorted - * @param array $sortColumns an associative array of columns to sort - * after and their sorting flags + * @param array $array The reference of the array to be sorted + * @param array $sortColumns An associative array of columns to sort + * after and their sorting flags */ function array_sort_by_multiple_keys(array &$array, array $sortColumns): bool { @@ -129,10 +132,10 @@ function array_sort_by_multiple_keys(array &$array, array $sortColumns): bool /** * Flatten a multidimensional array using dots as separators. * - * @param iterable $array The multi-dimensional array - * @param string $id Something to initially prepend to the flattened keys + * @param iterable $array The multi-dimensional array + * @param string $id Something to initially prepend to the flattened keys * - * @return array The flattened array + * @return array The flattened array */ function array_flatten_with_dots(iterable $array, string $id = ''): array { @@ -156,11 +159,11 @@ function array_flatten_with_dots(iterable $array, string $id = ''): array /** * Groups all rows by their index values. Result's depth equals number of indexes * - * @param array $array Data array (i.e. from query result) - * @param array $indexes Indexes to group by. Dot syntax used. Returns $array if empty - * @param bool $includeEmpty If true, null and '' are also added as valid keys to group + * @param array $array Data array (i.e. from query result) + * @param list $indexes Indexes to group by. Dot syntax used. Returns $array if empty + * @param bool $includeEmpty If true, null and '' are also added as valid keys to group * - * @return array Result array where rows are grouped together by indexes values. + * @return array Result array where rows are grouped together by indexes values. */ function array_group_by(array $array, array $indexes, bool $includeEmpty = false): array { diff --git a/system/Helpers/filesystem_helper.php b/system/Helpers/filesystem_helper.php index 3f5ed25f8531..f9a04dd142df 100644 --- a/system/Helpers/filesystem_helper.php +++ b/system/Helpers/filesystem_helper.php @@ -24,9 +24,10 @@ * directory will be mapped as well. * * @param string $sourceDir Path to source - * @param int $directoryDepth Depth of directories to traverse - * (0 = fully recursive, 1 = current dir, etc) + * @param int $directoryDepth Depth of directories to traverse (0 = fully recursive, 1 = current dir, etc) * @param bool $hidden Whether to show hidden files + * + * @return array|string> */ function directory_map(string $sourceDir, int $directoryDepth = 0, bool $hidden = false): array { @@ -200,6 +201,8 @@ function delete_files(string $path, bool $delDir = false, bool $htdocs = false, * @param bool|null $includePath Whether to include the path as part of the filename; false for no path, null for a relative path, true for full path * @param bool $hidden Whether to include hidden files (files beginning with a period) * @param bool $includeDir Whether to include directories + * + * @return list */ function get_filenames( string $sourceDir, diff --git a/system/Helpers/form_helper.php b/system/Helpers/form_helper.php index a1f7defc4d14..fc67aac601bf 100644 --- a/system/Helpers/form_helper.php +++ b/system/Helpers/form_helper.php @@ -23,9 +23,9 @@ * * Creates the opening portion of the form. * - * @param string $action the URI segments of the form destination - * @param array|string $attributes a key/value pair of attributes, or string representation - * @param array $hidden a key/value pair hidden data + * @param string $action The URI segments of the form destination + * @param array|string $attributes A key/value pair of attributes, or string representation + * @param array $hidden A key/value pair hidden data */ function form_open(string $action = '', $attributes = [], array $hidden = []): string { @@ -80,9 +80,9 @@ function form_open(string $action = '', $attributes = [], array $hidden = []): s * * Creates the opening portion of the form, but with "multipart/form-data". * - * @param string $action The URI segments of the form destination - * @param array|string $attributes A key/value pair of attributes, or the same as a string - * @param array $hidden A key/value pair hidden data + * @param string $action The URI segments of the form destination + * @param array|string $attributes A key/value pair of attributes, or the same as a string + * @param array $hidden A key/value pair hidden data */ function form_open_multipart(string $action = '', $attributes = [], array $hidden = []): string { @@ -103,8 +103,8 @@ function form_open_multipart(string $action = '', $attributes = [], array $hidde * Generates hidden fields. You can pass a simple key/value string or * an associative array with multiple values. * - * @param array|string $name Field name or associative array to create multiple fields - * @param array|string $value Field value + * @param array|string $name Field name or associative array to create multiple fields + * @param array|string|null $value Field value */ function form_hidden($name, $value = '', bool $recursing = false): string { @@ -140,8 +140,8 @@ function form_hidden($name, $value = '', bool $recursing = false): string * Text Input Field. If 'type' is passed in the $type field, it will be * used as the input type, for making 'email', 'phone', etc input fields. * - * @param array|string $data - * @param array|object|string $extra string, array, object that can be cast to array + * @param array|string $data + * @param array|object|string $extra String, array, object that can be cast to array */ function form_input($data = '', string $value = '', $extra = '', string $type = 'text'): string { @@ -161,8 +161,8 @@ function form_input($data = '', string $value = '', $extra = '', string $type = * * Identical to the input function but adds the "password" type * - * @param array|string $data - * @param array|object|string $extra string, array, object that can be cast to array + * @param array|string $data + * @param array|object|string $extra String, array, object that can be cast to array */ function form_password($data = '', string $value = '', $extra = ''): string { @@ -181,8 +181,8 @@ function form_password($data = '', string $value = '', $extra = ''): string * * Identical to the input function but adds the "file" type * - * @param array|string $data - * @param array|object|string $extra string, array, object that can be cast to array + * @param array|string $data + * @param array|object|string $extra String, array, object that can be cast to array */ function form_upload($data = '', string $value = '', $extra = ''): string { @@ -205,8 +205,8 @@ function form_upload($data = '', string $value = '', $extra = ''): string /** * Textarea field * - * @param array|string $data - * @param array|object|string $extra string, array, object that can be cast to array + * @param array|string $data + * @param array|object|string $extra String, array, object that can be cast to array */ function form_textarea($data = '', string $value = '', $extra = ''): string { @@ -241,8 +241,10 @@ function form_textarea($data = '', string $value = '', $extra = ''): string /** * Multi-select menu * - * @param array|string $name - * @param array|object|string $extra string, array, object that can be cast to array + * @param array|string $name + * @param array|string> $options + * @param array $selected + * @param array|object|string $extra String, array, object that can be cast to array */ function form_multiselect($name = '', array $options = [], array $selected = [], $extra = ''): string { @@ -260,10 +262,10 @@ function form_multiselect($name = '', array $options = [], array $selected = [], /** * Drop-down Menu * - * @param array|string $data - * @param array|string $options - * @param array|string $selected - * @param array|object|string $extra string, array, object that can be cast to array + * @param array|string $data + * @param array|string>|string $options + * @param array|string $selected + * @param array|object|string $extra String, array, object that can be cast to array */ function form_dropdown($data = '', $options = [], $selected = [], $extra = ''): string { @@ -348,8 +350,8 @@ function form_dropdown($data = '', $options = [], $selected = [], $extra = ''): /** * Checkbox Field * - * @param array|string $data - * @param array|object|string $extra string, array, object that can be cast to array + * @param array|string $data + * @param array|object|string $extra String, array, object that can be cast to array */ function form_checkbox($data = '', string $value = '', bool $checked = false, $extra = ''): string { @@ -381,8 +383,8 @@ function form_checkbox($data = '', string $value = '', bool $checked = false, $e /** * Radio Button * - * @param array|string $data - * @param array|object|string $extra string, array, object that can be cast to array + * @param array|string $data + * @param array|object|string $extra String, array, object that can be cast to array */ function form_radio($data = '', string $value = '', bool $checked = false, $extra = ''): string { @@ -399,8 +401,8 @@ function form_radio($data = '', string $value = '', bool $checked = false, $extr /** * Submit Button * - * @param array|string $data - * @param array|object|string $extra string, array, object that can be cast to array + * @param array|string $data + * @param array|object|string $extra String, array, object that can be cast to array */ function form_submit($data = '', string $value = '', $extra = ''): string { @@ -412,8 +414,8 @@ function form_submit($data = '', string $value = '', $extra = ''): string /** * Reset Button * - * @param array|string $data - * @param array|object|string $extra string, array, object that can be cast to array + * @param array|string $data + * @param array|object|string $extra String, array, object that can be cast to array */ function form_reset($data = '', string $value = '', $extra = ''): string { @@ -425,8 +427,8 @@ function form_reset($data = '', string $value = '', $extra = ''): string /** * Form Button * - * @param array|string $data - * @param array|object|string $extra string, array, object that can be cast to array + * @param array|string $data + * @param array|object|string $extra String, array, object that can be cast to array */ function form_button($data = '', string $content = '', $extra = ''): string { @@ -450,9 +452,9 @@ function form_button($data = '', string $content = '', $extra = ''): string /** * Form Label Tag * - * @param string $labelText The text to appear onscreen - * @param string $id The id the label applies to - * @param array $attributes Additional attributes + * @param string $labelText The text to appear onscreen + * @param string $id The id the label applies to + * @param array $attributes Additional attributes */ function form_label(string $labelText = '', string $id = '', array $attributes = []): string { @@ -477,6 +479,8 @@ function form_label(string $labelText = '', string $id = '', array $attributes = * The element specifies a list of pre-defined options for an element. * Users will see a drop-down list of pre-defined options as they input data. * The list attribute of the element, must refer to the id attribute of the element. + * + * @param list $options */ function form_datalist(string $name, string $value, array $options): string { @@ -506,8 +510,8 @@ function form_datalist(string $name, string $value, array $options): string * Used to produce
text. To close fieldset * use form_fieldset_close() * - * @param string $legendText The legend text - * @param array $attributes Additional attributes + * @param string $legendText The legend text + * @param array $attributes Additional attributes */ function form_fieldset(string $legendText = '', array $attributes = []): string { @@ -770,8 +774,8 @@ function validation_show_error(string $field, string $template = 'single'): stri * * @internal * - * @param array|string $attributes List of attributes - * @param array $default Default values + * @param array|string $attributes List of attributes + * @param array $default Default values */ function parse_form_attributes($attributes, array $default): string { diff --git a/system/Helpers/html_helper.php b/system/Helpers/html_helper.php index 9dcf82536eeb..e206cbd0f5e5 100644 --- a/system/Helpers/html_helper.php +++ b/system/Helpers/html_helper.php @@ -24,8 +24,8 @@ * Generates an HTML unordered list from a single or * multidimensional array. * - * @param array $list List entries - * @param array|object|string $attributes HTML attributes string, array, object + * @param array|string> $list List entries + * @param array|object|string $attributes HTML attributes string, array, object */ function ul(array $list, $attributes = ''): string { @@ -39,8 +39,8 @@ function ul(array $list, $attributes = ''): string * * Generates an HTML ordered list from a single or multidimensional array. * - * @param array $list List entries - * @param array|object|string $attributes HTML attributes string, array, object + * @param array|string> $list List entries + * @param array|object|string $attributes HTML attributes string, array, object */ function ol(array $list, $attributes = ''): string { @@ -54,8 +54,8 @@ function ol(array $list, $attributes = ''): string * * Generates an HTML ordered list from a single or multidimensional array. * - * @param array $list List entries - * @param array|object|string $attributes HTML attributes string, array, object + * @param array|string> $list List entries + * @param array|object|string $attributes HTML attributes string, array, object */ function _list(string $type = 'ul', $list = [], $attributes = '', int $depth = 0): string { @@ -93,9 +93,9 @@ function _list(string $type = 'ul', $list = [], $attributes = '', int $depth = 0 * * Generates an image element * - * @param array|string $src Image source URI, or array of attributes and values - * @param bool $indexPage Should `Config\App::$indexPage` be added to the source path - * @param array|object|string $attributes Additional HTML attributes + * @param array|string $src Image source URI, or array of attributes and values + * @param bool $indexPage Should `Config\App::$indexPage` be added to the source path + * @param array|object|string $attributes Additional HTML attributes */ function img($src = '', bool $indexPage = false, $attributes = ''): string { @@ -193,8 +193,8 @@ function doctype(string $type = 'html5'): string * * Generates link to a JS file * - * @param array|string $src Script source or an array of attributes - * @param bool $indexPage Should `Config\App::$indexPage` be added to the JS path + * @param array|string $src Script source or an array of attributes + * @param bool $indexPage Should `Config\App::$indexPage` be added to the JS path */ function script_tag($src = '', bool $indexPage = false): string { @@ -287,10 +287,11 @@ function link_tag( * Generates a video element to embed videos. The video element can * contain one or more video sources * - * @param array|string $src Either a source string or an array of sources - * @param string $unsupportedMessage The message to display if the media tag is not supported by the browser - * @param string $attributes HTML attributes - * @param bool $indexPage Should `Config\App::$indexPage` be added to the source path + * @param list|string $src Either a source string or an array of sources + * @param string $unsupportedMessage The message to display if the media tag is not supported by the browser + * @param string $attributes HTML attributes + * @param list $tracks Track elements + * @param bool $indexPage Should `Config\App::$indexPage` be added to the source path */ function video($src, string $unsupportedMessage = '', string $attributes = '', array $tracks = [], bool $indexPage = false): string { @@ -334,10 +335,11 @@ function video($src, string $unsupportedMessage = '', string $attributes = '', a * * Generates an audio element to embed sounds * - * @param array|string $src Either a source string or an array of sources - * @param string $unsupportedMessage The message to display if the media tag is not supported by the browser. - * @param string $attributes HTML attributes - * @param bool $indexPage Should `Config\App::$indexPage` be added to the source path + * @param list|string $src Either a source string or an array of sources + * @param string $unsupportedMessage The message to display if the media tag is not supported by the browser. + * @param string $attributes HTML attributes + * @param list $tracks Track elements + * @param bool $indexPage Should `Config\App::$indexPage` be added to the source path */ function audio($src, string $unsupportedMessage = '', string $attributes = '', array $tracks = [], bool $indexPage = false): string { @@ -377,7 +379,9 @@ function audio($src, string $unsupportedMessage = '', string $attributes = '', a /** * Generate media based tag * - * @param string $unsupportedMessage The message to display if the media tag is not supported by the browser. + * @param list $types Source elements + * @param string $unsupportedMessage The message to display if the media tag is not supported by the browser. + * @param list $tracks Track elements */ function _media(string $name, array $types = [], string $unsupportedMessage = '', string $attributes = '', array $tracks = []): string { @@ -466,10 +470,11 @@ function track(string $src, string $kind, string $srcLanguage, string $label): s * as either image or a resource plugin such as audio, video, * Java applets, ActiveX, PDF and Flash * - * @param string $data A resource URL - * @param string $type Content-type of the resource - * @param string $attributes HTML attributes - * @param bool $indexPage Should `Config\App::$indexPage` be added to the data path + * @param string $data A resource URL + * @param string $type Content-type of the resource + * @param string $attributes HTML attributes + * @param list $params Param elements + * @param bool $indexPage Should `Config\App::$indexPage` be added to the data path */ function object(string $data, string $type = 'unknown', string $attributes = '', array $params = [], bool $indexPage = false): string { diff --git a/system/Helpers/kint_helper.php b/system/Helpers/kint_helper.php index 8d8e73bfc92f..02d180328e92 100644 --- a/system/Helpers/kint_helper.php +++ b/system/Helpers/kint_helper.php @@ -18,7 +18,7 @@ /** * Prints a Kint debug report and exits. * - * @param array $vars + * @param mixed ...$vars * * @return never * @@ -38,7 +38,7 @@ function dd(...$vars): void /** * dd function * - * @param array $vars + * @param mixed ...$vars * * @return int */ @@ -54,7 +54,7 @@ function dd(...$vars) /** * d function * - * @param array $vars + * @param mixed ...$vars * * @return int */ diff --git a/system/Helpers/number_helper.php b/system/Helpers/number_helper.php index bf577ed293f6..120e33d795cd 100644 --- a/system/Helpers/number_helper.php +++ b/system/Helpers/number_helper.php @@ -134,6 +134,8 @@ function number_to_currency(float $num, string $currency, ?string $locale = null /** * A general purpose, locale-aware, number_format method. * Used by all of the functions of the number_helper. + * + * @param array $options */ function format_number(float $num, int $precision = 1, ?string $locale = null, array $options = []): string { diff --git a/system/Helpers/test_helper.php b/system/Helpers/test_helper.php index 645d407dfcbf..b455aa301e2f 100644 --- a/system/Helpers/test_helper.php +++ b/system/Helpers/test_helper.php @@ -22,11 +22,11 @@ /** * Creates a single item using Fabricator. * - * @param Model|object|string $model Instance or name of the model - * @param array|null $overrides Overriding data to pass to Fabricator::setOverrides() - * @param bool $persist + * @param Model|object|string $model Instance or name of the model + * @param array|null $overrides Overriding data to pass to Fabricator::setOverrides() + * @param bool $persist * - * @return array|object + * @return array|object */ function fake($model, ?array $overrides = null, $persist = true) { diff --git a/system/Helpers/text_helper.php b/system/Helpers/text_helper.php index b8298953bdd3..f8ea0c15447c 100644 --- a/system/Helpers/text_helper.php +++ b/system/Helpers/text_helper.php @@ -174,9 +174,9 @@ function entities_to_ascii(string $str, bool $all = true): string * matched words will be converted to #### or to the replacement * word you've submitted. * - * @param string $str the text string - * @param array $censored the array of censored words - * @param string $replacement the optional replacement value + * @param string $str The text string + * @param list $censored The array of censored words + * @param string $replacement The optional replacement value */ function word_censor(string $str, array $censored, string $replacement = ''): string { @@ -454,9 +454,9 @@ function ellipsize(string $str, int $maxLength, $position = 1, string $ellipsis * * Removes slashes contained in a string or in an array * - * @param array|string $str string or array + * @param array|string $str string or array * - * @return array|string string or array + * @return array|string string or array */ function strip_slashes($str) { diff --git a/system/Helpers/url_helper.php b/system/Helpers/url_helper.php index 208ae722a2f2..0b3fa5f72c9c 100644 --- a/system/Helpers/url_helper.php +++ b/system/Helpers/url_helper.php @@ -25,11 +25,11 @@ /** * Returns a site URL as defined by the App config. * - * @param array|string $relativePath URI string or array of URI segments. - * @param string|null $scheme URI scheme. E.g., http, ftp. If empty - * string '' is set, a protocol-relative - * link is returned. - * @param App|null $config Alternate configuration to use. + * @param list|string $relativePath URI string or array of URI segments. + * @param string|null $scheme URI scheme. E.g., http, ftp. If empty + * string '' is set, a protocol-relative + * link is returned. + * @param App|null $config Alternate configuration to use. */ function site_url($relativePath = '', ?string $scheme = null, ?App $config = null): string { @@ -46,10 +46,10 @@ function site_url($relativePath = '', ?string $scheme = null, ?App $config = nul * Returns the base URL as defined by the App config. * Base URLs are trimmed site URLs without the index page. * - * @param array|string $relativePath URI string or array of URI segments. - * @param string|null $scheme URI scheme. E.g., http, ftp. If empty - * string '' is set, a protocol-relative - * link is returned. + * @param list|string $relativePath URI string or array of URI segments. + * @param string|null $scheme URI scheme. E.g., http, ftp. If empty + * string '' is set, a protocol-relative + * link is returned. */ function base_url($relativePath = '', ?string $scheme = null): string { @@ -146,10 +146,10 @@ function index_page(?App $altConfig = null): string * * Creates an anchor based on the local URL. * - * @param array|string $uri URI string or array of URI segments - * @param string $title The link title - * @param array|object|string $attributes Any attributes - * @param App|null $altConfig Alternate configuration to use + * @param list|string $uri URI string or array of URI segments + * @param string $title The link title + * @param array|object|string $attributes Any attributes + * @param App|null $altConfig Alternate configuration to use */ function anchor($uri = '', string $title = '', $attributes = '', ?App $altConfig = null): string { @@ -179,10 +179,10 @@ function anchor($uri = '', string $title = '', $attributes = '', ?App $altConfig * Creates an anchor based on the local URL. The link * opens a new window based on the attributes specified. * - * @param string $uri the URL - * @param string $title the link title - * @param array|false|object|string $attributes any attributes - * @param App|null $altConfig Alternate configuration to use + * @param string $uri the URL + * @param string $title the link title + * @param array|false|object|string $attributes any attributes + * @param App|null $altConfig Alternate configuration to use */ function anchor_popup($uri = '', string $title = '', $attributes = false, ?App $altConfig = null): string { @@ -231,9 +231,9 @@ function anchor_popup($uri = '', string $title = '', $attributes = false, ?App $ /** * Mailto Link * - * @param string $email the email address - * @param string $title the link title - * @param array|object|string $attributes any attributes + * @param string $email the email address + * @param string $title the link title + * @param array|object|string $attributes any attributes */ function mailto(string $email, string $title = '', $attributes = ''): string { @@ -251,9 +251,9 @@ function mailto(string $email, string $title = '', $attributes = ''): string * * Create a spam-protected mailto link written in Javascript * - * @param string $email the email address - * @param string $title the link title - * @param array|object|string $attributes any attributes + * @param string $email the email address + * @param string $title the link title + * @param array|object|string $attributes any attributes */ function safe_mailto(string $email, string $title = '', $attributes = ''): string { diff --git a/utils/phpstan-baseline/argument.type.neon b/utils/phpstan-baseline/argument.type.neon index 80cb40694994..282cf8b2aa8b 100644 --- a/utils/phpstan-baseline/argument.type.neon +++ b/utils/phpstan-baseline/argument.type.neon @@ -1,4 +1,4 @@ -# total 64 errors +# total 63 errors parameters: ignoreErrors: @@ -122,11 +122,6 @@ parameters: count: 1 path: ../../tests/system/HTTP/SiteURITest.php - - - message: '#^Parameter \#2 \$value of function form_hidden expects array\|string, null given\.$#' - count: 1 - path: ../../tests/system/Helpers/FormHelperTest.php - - message: '#^Parameter \#1 \$num of function number_to_size expects int\|string, float given\.$#' count: 1 diff --git a/utils/phpstan-baseline/loader.neon b/utils/phpstan-baseline/loader.neon index 57a1c5ee9257..0c6937677154 100644 --- a/utils/phpstan-baseline/loader.neon +++ b/utils/phpstan-baseline/loader.neon @@ -1,4 +1,4 @@ -# total 1381 errors +# total 1285 errors includes: - argument.type.neon diff --git a/utils/phpstan-baseline/missingType.iterableValue.neon b/utils/phpstan-baseline/missingType.iterableValue.neon index 518e931c13d8..5c67c58552fd 100644 --- a/utils/phpstan-baseline/missingType.iterableValue.neon +++ b/utils/phpstan-baseline/missingType.iterableValue.neon @@ -1,4 +1,4 @@ -# total 1129 errors +# total 1034 errors parameters: ignoreErrors: @@ -2737,476 +2737,6 @@ parameters: count: 1 path: ../../system/HTTP/URI.php - - - message: '#^Method CodeIgniter\\Helpers\\Array\\ArrayHelper\:\:arrayAttachIndexedValue\(\) has parameter \$indexes with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/Array/ArrayHelper.php - - - - message: '#^Method CodeIgniter\\Helpers\\Array\\ArrayHelper\:\:arrayAttachIndexedValue\(\) has parameter \$result with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/Array/ArrayHelper.php - - - - message: '#^Method CodeIgniter\\Helpers\\Array\\ArrayHelper\:\:arrayAttachIndexedValue\(\) has parameter \$row with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/Array/ArrayHelper.php - - - - message: '#^Method CodeIgniter\\Helpers\\Array\\ArrayHelper\:\:arrayAttachIndexedValue\(\) return type has no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/Array/ArrayHelper.php - - - - message: '#^Method CodeIgniter\\Helpers\\Array\\ArrayHelper\:\:arraySearchDot\(\) has parameter \$array with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/Array/ArrayHelper.php - - - - message: '#^Method CodeIgniter\\Helpers\\Array\\ArrayHelper\:\:arraySearchDot\(\) has parameter \$indexes with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/Array/ArrayHelper.php - - - - message: '#^Method CodeIgniter\\Helpers\\Array\\ArrayHelper\:\:dotKeyExists\(\) has parameter \$array with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/Array/ArrayHelper.php - - - - message: '#^Method CodeIgniter\\Helpers\\Array\\ArrayHelper\:\:dotSearch\(\) has parameter \$array with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/Array/ArrayHelper.php - - - - message: '#^Method CodeIgniter\\Helpers\\Array\\ArrayHelper\:\:groupBy\(\) has parameter \$array with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/Array/ArrayHelper.php - - - - message: '#^Method CodeIgniter\\Helpers\\Array\\ArrayHelper\:\:groupBy\(\) has parameter \$indexes with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/Array/ArrayHelper.php - - - - message: '#^Method CodeIgniter\\Helpers\\Array\\ArrayHelper\:\:groupBy\(\) return type has no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/Array/ArrayHelper.php - - - - message: '#^Method CodeIgniter\\Helpers\\Array\\ArrayHelper\:\:recursiveCount\(\) has parameter \$array with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/Array/ArrayHelper.php - - - - message: '#^Method CodeIgniter\\Helpers\\Array\\ArrayHelper\:\:recursiveDiff\(\) has parameter \$compareWith with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/Array/ArrayHelper.php - - - - message: '#^Method CodeIgniter\\Helpers\\Array\\ArrayHelper\:\:recursiveDiff\(\) has parameter \$original with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/Array/ArrayHelper.php - - - - message: '#^Method CodeIgniter\\Helpers\\Array\\ArrayHelper\:\:recursiveDiff\(\) return type has no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/Array/ArrayHelper.php - - - - message: '#^Function array_deep_search\(\) has parameter \$array with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/array_helper.php - - - - message: '#^Function array_flatten_with_dots\(\) has parameter \$array with no value type specified in iterable type iterable\.$#' - count: 1 - path: ../../system/Helpers/array_helper.php - - - - message: '#^Function array_flatten_with_dots\(\) return type has no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/array_helper.php - - - - message: '#^Function array_group_by\(\) has parameter \$array with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/array_helper.php - - - - message: '#^Function array_group_by\(\) has parameter \$indexes with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/array_helper.php - - - - message: '#^Function array_group_by\(\) return type has no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/array_helper.php - - - - message: '#^Function array_sort_by_multiple_keys\(\) has parameter \$array with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/array_helper.php - - - - message: '#^Function array_sort_by_multiple_keys\(\) has parameter \$sortColumns with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/array_helper.php - - - - message: '#^Function dot_array_search\(\) has parameter \$array with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/array_helper.php - - - - message: '#^Function directory_map\(\) return type has no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/filesystem_helper.php - - - - message: '#^Function get_filenames\(\) return type has no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/filesystem_helper.php - - - - message: '#^Function form_button\(\) has parameter \$data with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/form_helper.php - - - - message: '#^Function form_button\(\) has parameter \$extra with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/form_helper.php - - - - message: '#^Function form_checkbox\(\) has parameter \$data with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/form_helper.php - - - - message: '#^Function form_checkbox\(\) has parameter \$extra with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/form_helper.php - - - - message: '#^Function form_datalist\(\) has parameter \$options with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/form_helper.php - - - - message: '#^Function form_dropdown\(\) has parameter \$data with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/form_helper.php - - - - message: '#^Function form_dropdown\(\) has parameter \$extra with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/form_helper.php - - - - message: '#^Function form_dropdown\(\) has parameter \$options with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/form_helper.php - - - - message: '#^Function form_dropdown\(\) has parameter \$selected with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/form_helper.php - - - - message: '#^Function form_fieldset\(\) has parameter \$attributes with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/form_helper.php - - - - message: '#^Function form_hidden\(\) has parameter \$name with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/form_helper.php - - - - message: '#^Function form_hidden\(\) has parameter \$value with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/form_helper.php - - - - message: '#^Function form_input\(\) has parameter \$data with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/form_helper.php - - - - message: '#^Function form_input\(\) has parameter \$extra with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/form_helper.php - - - - message: '#^Function form_label\(\) has parameter \$attributes with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/form_helper.php - - - - message: '#^Function form_multiselect\(\) has parameter \$extra with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/form_helper.php - - - - message: '#^Function form_multiselect\(\) has parameter \$name with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/form_helper.php - - - - message: '#^Function form_multiselect\(\) has parameter \$options with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/form_helper.php - - - - message: '#^Function form_multiselect\(\) has parameter \$selected with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/form_helper.php - - - - message: '#^Function form_open\(\) has parameter \$attributes with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/form_helper.php - - - - message: '#^Function form_open\(\) has parameter \$hidden with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/form_helper.php - - - - message: '#^Function form_open_multipart\(\) has parameter \$attributes with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/form_helper.php - - - - message: '#^Function form_open_multipart\(\) has parameter \$hidden with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/form_helper.php - - - - message: '#^Function form_password\(\) has parameter \$data with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/form_helper.php - - - - message: '#^Function form_password\(\) has parameter \$extra with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/form_helper.php - - - - message: '#^Function form_radio\(\) has parameter \$data with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/form_helper.php - - - - message: '#^Function form_radio\(\) has parameter \$extra with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/form_helper.php - - - - message: '#^Function form_reset\(\) has parameter \$data with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/form_helper.php - - - - message: '#^Function form_reset\(\) has parameter \$extra with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/form_helper.php - - - - message: '#^Function form_submit\(\) has parameter \$data with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/form_helper.php - - - - message: '#^Function form_submit\(\) has parameter \$extra with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/form_helper.php - - - - message: '#^Function form_textarea\(\) has parameter \$data with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/form_helper.php - - - - message: '#^Function form_textarea\(\) has parameter \$extra with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/form_helper.php - - - - message: '#^Function form_upload\(\) has parameter \$data with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/form_helper.php - - - - message: '#^Function form_upload\(\) has parameter \$extra with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/form_helper.php - - - - message: '#^Function parse_form_attributes\(\) has parameter \$attributes with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/form_helper.php - - - - message: '#^Function parse_form_attributes\(\) has parameter \$default with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/form_helper.php - - - - message: '#^Function _list\(\) has parameter \$attributes with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/html_helper.php - - - - message: '#^Function _list\(\) has parameter \$list with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/html_helper.php - - - - message: '#^Function _media\(\) has parameter \$tracks with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/html_helper.php - - - - message: '#^Function _media\(\) has parameter \$types with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/html_helper.php - - - - message: '#^Function audio\(\) has parameter \$src with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/html_helper.php - - - - message: '#^Function audio\(\) has parameter \$tracks with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/html_helper.php - - - - message: '#^Function img\(\) has parameter \$attributes with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/html_helper.php - - - - message: '#^Function img\(\) has parameter \$src with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/html_helper.php - - - - message: '#^Function object\(\) has parameter \$params with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/html_helper.php - - - - message: '#^Function ol\(\) has parameter \$attributes with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/html_helper.php - - - - message: '#^Function ol\(\) has parameter \$list with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/html_helper.php - - - - message: '#^Function script_tag\(\) has parameter \$src with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/html_helper.php - - - - message: '#^Function ul\(\) has parameter \$attributes with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/html_helper.php - - - - message: '#^Function ul\(\) has parameter \$list with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/html_helper.php - - - - message: '#^Function video\(\) has parameter \$src with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/html_helper.php - - - - message: '#^Function video\(\) has parameter \$tracks with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/html_helper.php - - - - message: '#^Function d\(\) has parameter \$vars with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/kint_helper.php - - - - message: '#^Function dd\(\) has parameter \$vars with no value type specified in iterable type array\.$#' - count: 2 - path: ../../system/Helpers/kint_helper.php - - - - message: '#^Function format_number\(\) has parameter \$options with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/number_helper.php - - - - message: '#^Function fake\(\) has parameter \$overrides with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/test_helper.php - - - - message: '#^Function fake\(\) return type has no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/test_helper.php - - - - message: '#^Function strip_slashes\(\) has parameter \$str with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/text_helper.php - - - - message: '#^Function strip_slashes\(\) return type has no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/text_helper.php - - - - message: '#^Function word_censor\(\) has parameter \$censored with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/text_helper.php - - - - message: '#^Function anchor\(\) has parameter \$attributes with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/url_helper.php - - - - message: '#^Function anchor\(\) has parameter \$uri with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/url_helper.php - - - - message: '#^Function anchor_popup\(\) has parameter \$attributes with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/url_helper.php - - - - message: '#^Function base_url\(\) has parameter \$relativePath with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/url_helper.php - - - - message: '#^Function mailto\(\) has parameter \$attributes with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/url_helper.php - - - - message: '#^Function safe_mailto\(\) has parameter \$attributes with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/url_helper.php - - - - message: '#^Function site_url\(\) has parameter \$relativePath with no value type specified in iterable type array\.$#' - count: 1 - path: ../../system/Helpers/url_helper.php - - message: '#^Method CodeIgniter\\HotReloader\\DirectoryHasher\:\:hashApp\(\) return type has no value type specified in iterable type array\.$#' count: 1