diff --git a/phpstan-baseline-7x.neon b/phpstan-baseline-7x.neon new file mode 100644 index 00000000000..3f622441623 --- /dev/null +++ b/phpstan-baseline-7x.neon @@ -0,0 +1,761 @@ +parameters: + ignoreErrors: + - + message: "#^Parameter \\#1 \\$str of function rawurldecode expects string, mixed given\\.$#" + count: 1 + path: application/controllers/DashboardController.php + + - + message: "#^Parameter \\#1 \\$stack of function array_shift expects array, array\\\\|false given\\.$#" + count: 1 + path: application/controllers/ErrorController.php + + - + message: "#^Parameter \\#1 \\$str of function rawurldecode expects string, mixed given\\.$#" + count: 1 + path: application/controllers/NavigationController.php + + - + message: "#^Parameter \\#1 \\$str of function ucwords expects string, mixed given\\.$#" + count: 1 + path: application/controllers/NavigationController.php + + - + message: "#^Parameter \\#1 \\$str of function sha1 expects string, mixed given\\.$#" + count: 1 + path: application/forms/Config/Resource/SshResourceForm.php + + - + message: "#^Parameter \\#2 \\$str of function explode expects string, mixed given\\.$#" + count: 1 + path: application/forms/Config/User/CreateMembershipForm.php + + - + message: "#^Parameter \\#2 \\$str of function explode expects string, mixed given\\.$#" + count: 1 + path: application/forms/Config/UserBackendReorderForm.php + + - + message: "#^Parameter \\#1 \\$arr1 of function array_merge expects array, mixed given\\.$#" + count: 1 + path: application/forms/Config/UserGroup/AddMemberForm.php + + - + message: "#^Parameter \\#2 \\$str of function explode expects string, mixed given\\.$#" + count: 1 + path: application/forms/Config/UserGroup/AddMemberForm.php + + - + message: "#^Parameter \\#1 \\$str of function strtolower expects string, mixed given\\.$#" + count: 1 + path: application/forms/Config/UserGroup/DbUserGroupBackendForm.php + + - + message: "#^Parameter \\#1 \\$str of function strtolower expects string, mixed given\\.$#" + count: 2 + path: application/forms/Config/UserGroup/LdapUserGroupBackendForm.php + + - + message: "#^Parameter \\#2 \\$pieces of function implode expects array, mixed given\\.$#" + count: 2 + path: application/forms/Navigation/NavigationConfigForm.php + + - + message: "#^Parameter \\#2 \\$str of function explode expects string, TKey of int\\|string given\\.$#" + count: 2 + path: application/forms/Security/RoleForm.php + + - + message: "#^Parameter \\#2 \\$newvalue of function ini_set expects string, int given\\.$#" + count: 2 + path: library/Icinga/Application/ApplicationBootstrap.php + + - + message: "#^Parameter \\#2 \\$str of function explode expects string, mixed given\\.$#" + count: 1 + path: library/Icinga/Application/ApplicationBootstrap.php + + - + message: "#^Parameter \\#1 \\$autoload_function of function spl_autoload_register expects callable\\(string\\)\\: void, array\\{\\$this\\(Icinga\\\\Application\\\\ClassLoader\\), 'loadClass'\\} given\\.$#" + count: 1 + path: library/Icinga/Application/ClassLoader.php + + - + message: "#^Parameter \\#2 \\$start of function substr expects int, int\\<0, max\\>\\|false given\\.$#" + count: 1 + path: library/Icinga/Application/ClassLoader.php + + - + message: "#^Parameter \\#3 \\$length of function substr expects int, int\\<0, max\\>\\|false given\\.$#" + count: 2 + path: library/Icinga/Application/ClassLoader.php + + - + message: "#^Parameter \\#3 \\$length of function substr expects int, int\\<0, max\\>\\|false given\\.$#" + count: 1 + path: library/Icinga/Application/Hook/HealthHook.php + + - + message: "#^Parameter \\#2 \\$args of function vsprintf expects array\\, array\\ given\\.$#" + count: 1 + path: library/Icinga/Application/Hook/TicketHook.php + + - + message: "#^Parameter \\#1 \\$str of function ltrim expects string, string\\|false given\\.$#" + count: 1 + path: library/Icinga/Application/Libraries/Library.php + + - + message: "#^Parameter \\#1 \\$str of function strtolower expects string, mixed given\\.$#" + count: 2 + path: library/Icinga/Application/Logger.php + + - + message: "#^Parameter \\#1 \\$str of function strtoupper expects string, mixed given\\.$#" + count: 1 + path: library/Icinga/Application/Logger.php + + - + message: "#^Parameter \\#1 \\$dir_handle of function closedir expects resource, resource\\|false given\\.$#" + count: 1 + path: library/Icinga/Application/Modules/Module.php + + - + message: "#^Parameter \\#1 \\$dir_handle of function readdir expects resource, resource\\|false given\\.$#" + count: 1 + path: library/Icinga/Application/Modules/Module.php + + - + message: "#^Parameter \\#1 \\$str of function rtrim expects string, array\\|string\\|false given\\.$#" + count: 1 + path: library/Icinga/Application/Modules/Module.php + + - + message: "#^Parameter \\#1 \\$var of function count expects array\\|Countable, array\\\\|false given\\.$#" + count: 1 + path: library/Icinga/Application/Modules/Module.php + + - + message: "#^Parameter \\#1 \\$function of function call_user_func expects callable\\(\\)\\: mixed, array\\{\\$this\\(Icinga\\\\Application\\\\Modules\\\\NavigationItemContainer\\), string\\} given\\.$#" + count: 1 + path: library/Icinga/Application/Modules/NavigationItemContainer.php + + - + message: "#^Parameter \\#1 \\$stack of function array_shift expects array, array\\\\|false given\\.$#" + count: 1 + path: library/Icinga/Application/Platform.php + + - + message: "#^Parameter \\#1 \\$input of function array_flip expects array\\, array\\\\|false given\\.$#" + count: 1 + path: library/Icinga/Application/Test.php + + - + message: "#^Parameter \\#1 \\$str of function strtolower expects string, mixed given\\.$#" + count: 1 + path: library/Icinga/Authentication/User/UserBackend.php + + - + message: "#^Parameter \\#1 \\$str of function strtolower expects string, mixed given\\.$#" + count: 1 + path: library/Icinga/Authentication/UserGroup/UserGroupBackend.php + + - + message: "#^Parameter \\#1 \\$number of function round expects float, int\\|string given\\.$#" + count: 1 + path: library/Icinga/Chart/Donut.php + + - + message: "#^Parameter \\#1 \\$str of function strip_tags expects string, mixed given\\.$#" + count: 1 + path: library/Icinga/Chart/Graph/Tooltip.php + + - + message: "#^Parameter \\#2 \\$search of function array_key_exists expects array, Icinga\\\\Chart\\\\Graph\\\\Tooltip given\\.$#" + count: 1 + path: library/Icinga/Chart/GridChart.php + + - + message: "#^Parameter \\#1 \\$namespace of method DOMImplementation\\:\\:createDocument\\(\\) expects string, null given\\.$#" + count: 1 + path: library/Icinga/Chart/SVGRenderer.php + + - + message: "#^Parameter \\#1 \\$str of function rtrim expects string, string\\|null given\\.$#" + count: 1 + path: library/Icinga/Cli/Documentation/CommentParser.php + + - + message: "#^Parameter \\#1 \\$input of function array_values expects array, array\\|false given\\.$#" + count: 1 + path: library/Icinga/Cli/Loader.php + + - + message: "#^Parameter \\#1 \\$var of function count expects array\\|Countable, array\\|false given\\.$#" + count: 1 + path: library/Icinga/Cli/Loader.php + + - + message: "#^Parameter \\#2 \\$multiplier of function str_repeat expects int, float given\\.$#" + count: 1 + path: library/Icinga/Cli/Screen.php + + - + message: "#^Parameter \\#1 \\$str of function strtolower expects string, mixed given\\.$#" + count: 1 + path: library/Icinga/Data/Db/DbConnection.php + + - + message: "#^Parameter \\#1 \\$str of function trim expects string, mixed given\\.$#" + count: 1 + path: library/Icinga/Data/Db/DbConnection.php + + - + message: "#^Parameter \\#3 \\$length of function substr expects int, int\\<0, max\\>\\|false given\\.$#" + count: 1 + path: library/Icinga/Data/Filter/Filter.php + + - + message: "#^Parameter \\#1 \\$str of function strtolower expects string, bool\\|float\\|int\\|string given\\.$#" + count: 1 + path: library/Icinga/Data/Filter/FilterExpression.php + + - + message: "#^Parameter \\#1 \\$str of function strtolower expects string, mixed given\\.$#" + count: 1 + path: library/Icinga/Data/ResourceFactory.php + + - + message: "#^Parameter \\#1 \\$function of function call_user_func_array expects callable\\(\\)\\: mixed, 'parent\\:\\:__construct' given\\.$#" + count: 1 + path: library/Icinga/Exception/Http/HttpException.php + + - + message: "#^Parameter \\#2 \\$args of function vsprintf expects array\\, array\\ given\\.$#" + count: 1 + path: library/Icinga/Exception/IcingaException.php + + - + message: "#^Parameter \\#1 \\$str of function trim expects string, string\\|false given\\.$#" + count: 1 + path: library/Icinga/File/Ini/IniWriter.php + + - + message: "#^Parameter \\#1 \\$fp of function fclose expects resource, resource\\|false given\\.$#" + count: 1 + path: library/Icinga/File/Storage/LocalFileStorage.php + + - + message: "#^Parameter \\#1 \\$input of function array_splice expects array, array\\\\|false given\\.$#" + count: 2 + path: library/Icinga/File/Storage/LocalFileStorage.php + + - + message: "#^Parameter \\#1 \\$var of function count expects array\\|Countable, array\\\\|false given\\.$#" + count: 1 + path: library/Icinga/File/Storage/LocalFileStorage.php + + - + message: "#^Parameter \\#1 \\$dirname of function rmdir expects string, mixed given\\.$#" + count: 1 + path: library/Icinga/File/Storage/TemporaryLocalFileStorage.php + + - + message: "#^Parameter \\#1 \\$obj of function get_object_vars expects object, mixed given\\.$#" + count: 1 + path: library/Icinga/Protocol/Ldap/LdapConnection.php + + - + message: "#^Parameter \\#1 \\$str of function strtolower expects string, mixed given\\.$#" + count: 1 + path: library/Icinga/Protocol/Ldap/LdapConnection.php + + - + message: "#^Parameter \\#4 \\$attrs of callable 'ldap_list'\\|'ldap_read'\\|'ldap_search' expects array, array\\|null given\\.$#" + count: 2 + path: library/Icinga/Protocol/Ldap/LdapConnection.php + + - + message: "#^Parameter \\#1 \\$ascii of function chr expects int, float\\|int given\\.$#" + count: 1 + path: library/Icinga/Protocol/Ldap/LdapUtils.php + + - + message: "#^Parameter \\#1 \\$str of function strtolower expects string, mixed given\\.$#" + count: 2 + path: library/Icinga/Protocol/Ldap/Root.php + + - + message: "#^Parameter \\#2 \\$timestamp of function date expects int, float\\|int\\|string given\\.$#" + count: 1 + path: library/Icinga/Repository/Repository.php + + - + message: "#^Parameter \\#1 \\$array_arg of function natcasesort expects array, array\\\\|false given\\.$#" + count: 1 + path: library/Icinga/Util/DirectoryIterator.php + + - + message: "#^Parameter \\#2 \\$newvalue of function ini_set expects string, int given\\.$#" + count: 2 + path: library/Icinga/Util/Environment.php + + - + message: "#^Parameter \\#2 \\$array of function array_map expects array, array\\\\|false given\\.$#" + count: 1 + path: library/Icinga/Util/StringHelper.php + + - + message: "#^Parameter \\#2 \\$start of function substr expects int, float given\\.$#" + count: 1 + path: library/Icinga/Util/StringHelper.php + + - + message: "#^Parameter \\#3 \\$length of function substr expects int, float given\\.$#" + count: 1 + path: library/Icinga/Util/StringHelper.php + + - + message: "#^Parameter \\#1 \\$function of function call_user_func_array expects callable\\(\\)\\: mixed, array\\{\\$this\\(Icinga\\\\Web\\\\Controller\\\\ActionController\\), non\\-falsy\\-string\\} given\\.$#" + count: 1 + path: library/Icinga/Web/Controller/ActionController.php + + - + message: "#^Parameter \\#1 \\$str of function base64_encode expects string, string\\|false given\\.$#" + count: 1 + path: library/Icinga/Web/Controller/ActionController.php + + - + message: "#^Parameter \\#1 \\$str of function rawurlencode expects string, null given\\.$#" + count: 1 + path: library/Icinga/Web/Controller/ActionController.php + + - + message: "#^Parameter \\#2 \\$parameters of function call_user_func_array expects array\\, mixed given\\.$#" + count: 1 + path: library/Icinga/Web/Controller/ActionController.php + + - + message: "#^Parameter \\#1 \\$input of function str_pad expects string, int given\\.$#" + count: 1 + path: library/Icinga/Web/Controller/StaticController.php + + - + message: "#^Parameter \\#2 \\$mode of function mkdir expects int, float\\|int given\\.$#" + count: 2 + path: library/Icinga/Web/FileCache.php + + - + message: "#^Parameter \\#2 \\$search of function array_key_exists expects array, mixed given\\.$#" + count: 1 + path: library/Icinga/Web/Form.php + + - + message: "#^Parameter \\#3 \\$length of function substr expects int, int\\<0, max\\>\\|false given\\.$#" + count: 1 + path: library/Icinga/Web/Form/Element/DateTimePicker.php + + - + message: "#^Parameter \\#3 \\$length of function substr expects int, int\\<0, max\\>\\|false given\\.$#" + count: 1 + path: library/Icinga/Web/Form/Validator/DateTimeValidator.php + + - + message: "#^Parameter \\#1 \\$str of function ltrim expects string, bool\\|string given\\.$#" + count: 1 + path: library/Icinga/Web/JavaScript.php + + - + message: "#^Parameter \\#1 \\$str of function trim expects string, string\\|false given\\.$#" + count: 1 + path: library/Icinga/Web/JavaScript.php + + - + message: "#^Parameter \\#2 \\$replace of function preg_replace expects array\\|string, int given\\.$#" + count: 1 + path: library/Icinga/Web/Navigation/Navigation.php + + - + message: "#^Method Icinga\\\\Web\\\\RememberMe\\:\\:getAllByUsername\\(\\) should return array but returns array\\|false\\.$#" + count: 1 + path: library/Icinga/Web/RememberMe.php + + - + message: "#^Method Icinga\\\\Web\\\\RememberMe\\:\\:getAllUser\\(\\) should return array but returns array\\|false\\.$#" + count: 1 + path: library/Icinga/Web/RememberMe.php + + - + message: "#^Parameter \\#2 \\$newvalue of function ini_set expects string, false given\\.$#" + count: 2 + path: library/Icinga/Web/Session/PhpSession.php + + - + message: "#^Parameter \\#2 \\$newvalue of function ini_set expects string, null given\\.$#" + count: 1 + path: library/Icinga/Web/Session/PhpSession.php + + - + message: "#^Parameter \\#2 \\$newvalue of function ini_set expects string, string\\|false given\\.$#" + count: 1 + path: library/Icinga/Web/Session/PhpSession.php + + - + message: "#^Parameter \\#2 \\$newvalue of function ini_set expects string, true given\\.$#" + count: 2 + path: library/Icinga/Web/Session/PhpSession.php + + - + message: "#^Parameter \\#2 \\$timestamp of function date expects int, int\\|false given\\.$#" + count: 1 + path: library/Icinga/Web/Widget/Chart/HistoryColorGrid.php + + - + message: "#^Parameter \\#1 \\$str of function strtolower expects string, mixed given\\.$#" + count: 1 + path: library/Icinga/Web/Widget/SortBox.php + + - + message: "#^Parameter \\#1 \\$str of function substr_replace expects array\\|string, string\\|false given\\.$#" + count: 1 + path: modules/doc/library/Doc/Renderer/DocSectionRenderer.php + + - + message: "#^Parameter \\#1 \\$str of function trim expects string, string\\|null given\\.$#" + count: 1 + path: modules/doc/library/Doc/Renderer/DocSectionRenderer.php + + - + message: "#^Parameter \\#1 \\$str of function trim expects string, string\\|false given\\.$#" + count: 1 + path: modules/migrate/application/clicommands/ConfigCommand.php + + - + message: "#^Parameter \\#1 \\$old_name of function rename expects string, int\\|string given\\.$#" + count: 1 + path: modules/migrate/library/Migrate/Config/UserDomainMigration.php + + - + message: "#^Parameter \\#1 \\$str of function strtolower expects string, mixed given\\.$#" + count: 2 + path: modules/migrate/library/Migrate/Config/UserDomainMigration.php + + - + message: "#^Parameter \\#1 \\$str of function ucfirst expects string, string\\|null given\\.$#" + count: 1 + path: modules/monitoring/application/clicommands/ListCommand.php + + - + message: "#^Parameter \\#2 \\.\\.\\.\\$args of function array_merge expects array, array\\\\>\\|null given\\.$#" + count: 1 + path: modules/monitoring/application/controllers/EventController.php + + - + message: "#^Parameter \\#1 \\$str of function strtolower expects string, mixed given\\.$#" + count: 2 + path: modules/monitoring/application/controllers/ListController.php + + - + message: "#^Parameter \\#1 \\$time of function strtotime expects string, mixed given\\.$#" + count: 2 + path: modules/monitoring/application/controllers/TimelineController.php + + - + message: "#^Parameter \\#1 \\$var of function count expects array\\|Countable, array\\|ArrayAccess\\|Traversable given\\.$#" + count: 2 + path: modules/monitoring/application/forms/Command/Object/AcknowledgeProblemCommandForm.php + + - + message: "#^Parameter \\#1 \\$var of function count expects array\\|Countable, array\\|ArrayAccess\\|Traversable given\\.$#" + count: 2 + path: modules/monitoring/application/forms/Command/Object/AddCommentCommandForm.php + + - + message: "#^Parameter \\#1 \\$var of function count expects array\\|Countable, array\\|ArrayAccess\\|Traversable given\\.$#" + count: 1 + path: modules/monitoring/application/forms/Command/Object/CheckNowCommandForm.php + + - + message: "#^Parameter \\#1 \\$var of function count expects array\\|Countable, array\\|ArrayAccess\\|Traversable given\\.$#" + count: 2 + path: modules/monitoring/application/forms/Command/Object/ProcessCheckResultCommandForm.php + + - + message: "#^Parameter \\#1 \\$var of function count expects array\\|Countable, array\\|ArrayAccess\\|Traversable given\\.$#" + count: 3 + path: modules/monitoring/application/forms/Command/Object/RemoveAcknowledgementCommandForm.php + + - + message: "#^Parameter \\#1 \\$var of function count expects array\\|Countable, array\\|ArrayAccess\\|Traversable given\\.$#" + count: 1 + path: modules/monitoring/application/forms/Command/Object/ScheduleHostCheckCommandForm.php + + - + message: "#^Parameter \\#1 \\$str of function strtolower expects string, mixed given\\.$#" + count: 1 + path: modules/monitoring/application/forms/Command/Object/ScheduleHostDowntimeCommandForm.php + + - + message: "#^Parameter \\#1 \\$var of function count expects array\\|Countable, array\\|ArrayAccess\\|Traversable given\\.$#" + count: 1 + path: modules/monitoring/application/forms/Command/Object/ScheduleHostDowntimeCommandForm.php + + - + message: "#^Parameter \\#1 \\$var of function count expects array\\|Countable, array\\|ArrayAccess\\|Traversable given\\.$#" + count: 2 + path: modules/monitoring/application/forms/Command/Object/ScheduleServiceCheckCommandForm.php + + - + message: "#^Parameter \\#1 \\$var of function count expects array\\|Countable, array\\|ArrayAccess\\|Traversable given\\.$#" + count: 2 + path: modules/monitoring/application/forms/Command/Object/ScheduleServiceDowntimeCommandForm.php + + - + message: "#^Parameter \\#1 \\$var of function count expects array\\|Countable, array\\|ArrayAccess\\|Traversable given\\.$#" + count: 2 + path: modules/monitoring/application/forms/Command/Object/SendCustomNotificationCommandForm.php + + - + message: "#^Parameter \\#2 \\$str of function explode expects string, mixed given\\.$#" + count: 1 + path: modules/monitoring/application/forms/Config/TransportReorderForm.php + + - + message: "#^Parameter \\#1 \\$str of function trim expects string, string\\|null given\\.$#" + count: 1 + path: modules/monitoring/application/views/helpers/PluginOutput.php + + - + message: "#^Parameter \\#1 \\$str of function urlencode expects string, array\\|string given\\.$#" + count: 1 + path: modules/monitoring/application/views/helpers/PluginOutput.php + + - + message: "#^Parameter \\#1 \\$input of function array_keys expects array, \\(float\\|int\\) given\\.$#" + count: 1 + path: modules/monitoring/library/Monitoring/Backend/Ido/Query/CommentQuery.php + + - + message: "#^Parameter \\#2 \\$columns of method Icinga\\\\Module\\\\Monitoring\\\\Backend\\\\Ido\\\\Query\\\\IdoQuery\\:\\:createSubQuery\\(\\) expects array, null given\\.$#" + count: 1 + path: modules/monitoring/library/Monitoring/Backend/Ido/Query/CommentQuery.php + + - + message: "#^Parameter \\#1 \\$arr1 of function array_merge expects array, null given\\.$#" + count: 1 + path: modules/monitoring/library/Monitoring/Backend/Ido/Query/CommentdeletionhistoryQuery.php + + - + message: "#^Parameter \\#1 \\$input of function array_keys expects array, \\(float\\|int\\) given\\.$#" + count: 1 + path: modules/monitoring/library/Monitoring/Backend/Ido/Query/CommentdeletionhistoryQuery.php + + - + message: "#^Parameter \\#2 \\$columns of method Icinga\\\\Module\\\\Monitoring\\\\Backend\\\\Ido\\\\Query\\\\IdoQuery\\:\\:createSubQuery\\(\\) expects array, array\\\\|null given\\.$#" + count: 1 + path: modules/monitoring/library/Monitoring/Backend/Ido/Query/CommentdeletionhistoryQuery.php + + - + message: "#^Parameter \\#1 \\$arr1 of function array_merge expects array, null given\\.$#" + count: 1 + path: modules/monitoring/library/Monitoring/Backend/Ido/Query/CommenthistoryQuery.php + + - + message: "#^Parameter \\#1 \\$input of function array_keys expects array, \\(float\\|int\\) given\\.$#" + count: 1 + path: modules/monitoring/library/Monitoring/Backend/Ido/Query/CommenthistoryQuery.php + + - + message: "#^Parameter \\#2 \\$columns of method Icinga\\\\Module\\\\Monitoring\\\\Backend\\\\Ido\\\\Query\\\\IdoQuery\\:\\:createSubQuery\\(\\) expects array, array\\\\|null given\\.$#" + count: 1 + path: modules/monitoring/library/Monitoring/Backend/Ido/Query/CommenthistoryQuery.php + + - + message: "#^Parameter \\#1 \\$input of function array_keys expects array, \\(float\\|int\\) given\\.$#" + count: 1 + path: modules/monitoring/library/Monitoring/Backend/Ido/Query/DowntimeQuery.php + + - + message: "#^Parameter \\#2 \\$columns of method Icinga\\\\Module\\\\Monitoring\\\\Backend\\\\Ido\\\\Query\\\\IdoQuery\\:\\:createSubQuery\\(\\) expects array, null given\\.$#" + count: 1 + path: modules/monitoring/library/Monitoring/Backend/Ido/Query/DowntimeQuery.php + + - + message: "#^Parameter \\#1 \\$arr1 of function array_merge expects array, null given\\.$#" + count: 1 + path: modules/monitoring/library/Monitoring/Backend/Ido/Query/DowntimeendhistoryQuery.php + + - + message: "#^Parameter \\#1 \\$input of function array_keys expects array, \\(float\\|int\\) given\\.$#" + count: 1 + path: modules/monitoring/library/Monitoring/Backend/Ido/Query/DowntimeendhistoryQuery.php + + - + message: "#^Parameter \\#2 \\$columns of method Icinga\\\\Module\\\\Monitoring\\\\Backend\\\\Ido\\\\Query\\\\IdoQuery\\:\\:createSubQuery\\(\\) expects array, array\\\\|null given\\.$#" + count: 1 + path: modules/monitoring/library/Monitoring/Backend/Ido/Query/DowntimeendhistoryQuery.php + + - + message: "#^Parameter \\#1 \\$arr1 of function array_merge expects array, null given\\.$#" + count: 1 + path: modules/monitoring/library/Monitoring/Backend/Ido/Query/DowntimestarthistoryQuery.php + + - + message: "#^Parameter \\#1 \\$input of function array_keys expects array, \\(float\\|int\\) given\\.$#" + count: 1 + path: modules/monitoring/library/Monitoring/Backend/Ido/Query/DowntimestarthistoryQuery.php + + - + message: "#^Parameter \\#2 \\$columns of method Icinga\\\\Module\\\\Monitoring\\\\Backend\\\\Ido\\\\Query\\\\IdoQuery\\:\\:createSubQuery\\(\\) expects array, array\\\\|null given\\.$#" + count: 1 + path: modules/monitoring/library/Monitoring/Backend/Ido/Query/DowntimestarthistoryQuery.php + + - + message: "#^Parameter \\#1 \\$arr1 of function array_merge expects array, null given\\.$#" + count: 1 + path: modules/monitoring/library/Monitoring/Backend/Ido/Query/FlappingendhistoryQuery.php + + - + message: "#^Parameter \\#1 \\$input of function array_keys expects array, \\(float\\|int\\) given\\.$#" + count: 1 + path: modules/monitoring/library/Monitoring/Backend/Ido/Query/FlappingendhistoryQuery.php + + - + message: "#^Parameter \\#2 \\$columns of method Icinga\\\\Module\\\\Monitoring\\\\Backend\\\\Ido\\\\Query\\\\IdoQuery\\:\\:createSubQuery\\(\\) expects array, array\\\\|null given\\.$#" + count: 1 + path: modules/monitoring/library/Monitoring/Backend/Ido/Query/FlappingendhistoryQuery.php + + - + message: "#^Parameter \\#1 \\$arr1 of function array_merge expects array, null given\\.$#" + count: 1 + path: modules/monitoring/library/Monitoring/Backend/Ido/Query/FlappingstarthistoryQuery.php + + - + message: "#^Parameter \\#1 \\$input of function array_keys expects array, \\(float\\|int\\) given\\.$#" + count: 1 + path: modules/monitoring/library/Monitoring/Backend/Ido/Query/FlappingstarthistoryQuery.php + + - + message: "#^Parameter \\#2 \\$columns of method Icinga\\\\Module\\\\Monitoring\\\\Backend\\\\Ido\\\\Query\\\\IdoQuery\\:\\:createSubQuery\\(\\) expects array, array\\\\|null given\\.$#" + count: 1 + path: modules/monitoring/library/Monitoring/Backend/Ido/Query/FlappingstarthistoryQuery.php + + - + message: "#^Parameter \\#2 \\$search of function array_key_exists expects array, mixed given\\.$#" + count: 1 + path: modules/monitoring/library/Monitoring/Backend/Ido/Query/IdoQuery.php + + - + message: "#^Parameter \\#1 \\$arr1 of function array_merge expects array, null given\\.$#" + count: 1 + path: modules/monitoring/library/Monitoring/Backend/Ido/Query/StatehistoryQuery.php + + - + message: "#^Parameter \\#1 \\$input of function array_keys expects array, \\(float\\|int\\) given\\.$#" + count: 1 + path: modules/monitoring/library/Monitoring/Backend/Ido/Query/StatehistoryQuery.php + + - + message: "#^Parameter \\#2 \\$columns of method Icinga\\\\Module\\\\Monitoring\\\\Backend\\\\Ido\\\\Query\\\\IdoQuery\\:\\:createSubQuery\\(\\) expects array, array\\\\|null given\\.$#" + count: 1 + path: modules/monitoring/library/Monitoring/Backend/Ido/Query/StatehistoryQuery.php + + - + message: "#^Parameter \\#1 \\$stack of function array_pop expects array, array\\\\|false given\\.$#" + count: 2 + path: modules/monitoring/library/Monitoring/Backend/MonitoringBackend.php + + - + message: "#^Parameter \\#1 \\$stack of function array_pop expects array, mixed given\\.$#" + count: 1 + path: modules/monitoring/library/Monitoring/Command/Transport/ApiCommandTransport.php + + - + message: "#^Parameter \\#1 \\$str of function strtolower expects string, mixed given\\.$#" + count: 1 + path: modules/monitoring/library/Monitoring/Command/Transport/CommandTransport.php + + - + message: "#^Cannot access offset string on array\\{command\\: string, pid\\: int, running\\: bool, signaled\\: bool, stopped\\: bool, exitcode\\: int, termsig\\: int, stopsig\\: int\\}\\|false\\.$#" + count: 1 + path: modules/monitoring/library/Monitoring/Command/Transport/RemoteCommandFile.php + + - + message: "#^Parameter \\#1 \\$str of function strtolower expects string, mixed given\\.$#" + count: 1 + path: modules/monitoring/library/Monitoring/Controller.php + + - + message: "#^Parameter \\#2 \\$str of function explode expects string, mixed given\\.$#" + count: 1 + path: modules/monitoring/library/Monitoring/Object/MonitoredObject.php + + - + message: "#^Parameter \\#2 \\.\\.\\.\\$args of function array_merge expects array, array\\\\|false given\\.$#" + count: 1 + path: modules/monitoring/library/Monitoring/Web/Rest/RestRequest.php + + - + message: "#^Parameter \\#1 \\$array_arg of function key expects array\\|object, mixed given\\.$#" + count: 1 + path: modules/monitoring/library/Monitoring/Web/Widget/CustomVarTable.php + + - + message: "#^Parameter \\#1 \\$file of function file_put_contents expects string, mixed given\\.$#" + count: 1 + path: modules/setup/application/clicommands/ConfigCommand.php + + - + message: "#^Parameter \\#1 \\$str of function trim expects string, mixed given\\.$#" + count: 7 + path: modules/setup/application/clicommands/ConfigCommand.php + + - + message: "#^Parameter \\#2 \\$mode of function chmod expects int, float\\|int given\\.$#" + count: 1 + path: modules/setup/application/clicommands/ConfigCommand.php + + - + message: "#^Parameter \\#1 \\$data of function bin2hex expects string, string\\|false given\\.$#" + count: 1 + path: modules/setup/application/clicommands/TokenCommand.php + + - + message: "#^Parameter \\#1 \\$str of function md5 expects string, int\\<0, max\\> given\\.$#" + count: 1 + path: modules/setup/application/clicommands/TokenCommand.php + + - + message: "#^Parameter \\#1 \\$str of function strtolower expects string, mixed given\\.$#" + count: 1 + path: modules/setup/library/Setup/Requirement/OSRequirement.php + + - + message: "#^Parameter \\#1 \\$str of function ucfirst expects string, mixed given\\.$#" + count: 1 + path: modules/setup/library/Setup/Requirement/OSRequirement.php + + - + message: "#^Parameter \\#1 \\$var of function count expects array\\|Countable, array\\|null given\\.$#" + count: 1 + path: modules/setup/library/Setup/Utils/DbTool.php + + - + message: "#^Parameter \\#1 \\$str of function trim expects string, string\\|false given\\.$#" + count: 1 + path: modules/setup/library/Setup/Web/Form/Validator/TokenValidator.php + + - + message: "#^Parameter \\#1 \\$var of function count expects array\\|Countable, int given\\.$#" + count: 1 + path: modules/translation/library/Translation/Cli/ArrayToTextTableHelper.php + + - + message: "#^Parameter \\#2 \\$start of function substr expects int, int\\<0, max\\>\\|false given\\.$#" + count: 1 + path: modules/translation/library/Translation/Util/GettextTranslationHelper.php + + - + message: "#^Parameter \\#3 \\$length of function substr expects int, int\\<0, max\\>\\|false given\\.$#" + count: 1 + path: modules/translation/library/Translation/Util/GettextTranslationHelper.php diff --git a/phpstan-baseline-8.0.neon b/phpstan-baseline-8.0.neon new file mode 100644 index 00000000000..d9183280256 --- /dev/null +++ b/phpstan-baseline-8.0.neon @@ -0,0 +1,31 @@ +parameters: + ignoreErrors: + - + message: "#^Parameter \\#2 \\$value of function ini_set expects string, int given\\.$#" + count: 2 + path: library/Icinga/Application/ApplicationBootstrap.php + + - + message: "#^Parameter \\#2 \\$value of function ini_set expects string, int given\\.$#" + count: 2 + path: library/Icinga/Util/Environment.php + + - + message: "#^Parameter \\#2 \\$value of function ini_set expects string, false given\\.$#" + count: 2 + path: library/Icinga/Web/Session/PhpSession.php + + - + message: "#^Parameter \\#2 \\$value of function ini_set expects string, null given\\.$#" + count: 1 + path: library/Icinga/Web/Session/PhpSession.php + + - + message: "#^Parameter \\#2 \\$value of function ini_set expects string, string\\|false given\\.$#" + count: 1 + path: library/Icinga/Web/Session/PhpSession.php + + - + message: "#^Parameter \\#2 \\$value of function ini_set expects string, true given\\.$#" + count: 2 + path: library/Icinga/Web/Session/PhpSession.php diff --git a/phpstan-baseline-8.1+.neon b/phpstan-baseline-8.1+.neon new file mode 100644 index 00000000000..b952a7e04df --- /dev/null +++ b/phpstan-baseline-8.1+.neon @@ -0,0 +1,21 @@ +parameters: + ignoreErrors: + - + message: "#^Parameter \\#2 \\$result of function ldap_first_entry expects LDAP\\\\Result, array\\|LDAP\\\\Result given\\.$#" + count: 2 + path: library/Icinga/Protocol/Ldap/LdapCapabilities.php + + - + message: "#^Cannot access offset 'dn' on array\\|int\\.$#" + count: 1 + path: library/Icinga/Protocol/Ldap/LdapConnection.php + + - + message: "#^Parameter \\#2 \\$result of function ldap_count_entries expects LDAP\\\\Result, array\\|LDAP\\\\Result given\\.$#" + count: 1 + path: library/Icinga/Protocol/Ldap/LdapConnection.php + + - + message: "#^Parameter \\#2 \\$result of function ldap_get_entries expects LDAP\\\\Result, array\\|LDAP\\\\Result given\\.$#" + count: 1 + path: library/Icinga/Protocol/Ldap/LdapConnection.php diff --git a/phpstan-baseline-by-php-version.php b/phpstan-baseline-by-php-version.php new file mode 100644 index 00000000000..d80427edbcb --- /dev/null +++ b/phpstan-baseline-by-php-version.php @@ -0,0 +1,14 @@ + $includes +]; diff --git a/phpstan-baseline.neon b/phpstan-baseline-standard.neon similarity index 99% rename from phpstan-baseline.neon rename to phpstan-baseline-standard.neon index 22a196d1b0a..79fc457dbb8 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline-standard.neon @@ -2856,7 +2856,7 @@ parameters: path: library/Icinga/Application/ApplicationBootstrap.php - - message: "#^Parameter \\#2 \\$callback of function array_filter expects callable\\(non\\-empty\\-string\\|false\\)\\: mixed, 'is_dir' given\\.$#" + message: "#^Parameter \\#2 \\$callback of function array_filter expects \\(callable\\(non\\-empty\\-string\\|false\\)\\: mixed\\)\\|null, 'is_dir' given\\.$#" count: 1 path: library/Icinga/Application/ApplicationBootstrap.php @@ -3300,6 +3300,11 @@ parameters: count: 1 path: library/Icinga/Application/Hook/AuthenticationHook.php + - + message: "#^Call to an undefined method ipl\\\\Sql\\\\Connection\\:\\:exec\\(\\)\\.$#" + count: 1 + path: library/Icinga/Application/Hook/Common/DbMigrationStep.php + - message: "#^Method Icinga\\\\Application\\\\Hook\\\\ConfigFormEventsHook\\:\\:getLastErrors\\(\\) return type has no value type specified in iterable type array\\.$#" count: 1 @@ -6565,11 +6570,6 @@ parameters: count: 1 path: library/Icinga/Cli/Documentation/CommentParser.php - - - message: "#^Cannot access an offset on array\\|float\\|int\\|string\\|false\\|null\\.$#" - count: 1 - path: library/Icinga/Cli/Documentation/CommentParser.php - - message: "#^Method Icinga\\\\Cli\\\\Documentation\\\\CommentParser\\:\\:__construct\\(\\) has parameter \\$raw with no type specified\\.$#" count: 1 @@ -6590,11 +6590,6 @@ parameters: count: 1 path: library/Icinga/Cli/Documentation/CommentParser.php - - - message: "#^Parameter \\#1 \\$string of function rtrim expects string, string\\|null given\\.$#" - count: 1 - path: library/Icinga/Cli/Documentation/CommentParser.php - - message: "#^Parameter \\#2 \\$subject of function preg_split expects string, array\\\\|string\\|null given\\.$#" count: 1 @@ -9886,32 +9881,37 @@ parameters: path: library/Icinga/Protocol/Ldap/LdapConnection.php - - message: "#^Method Icinga\\\\Protocol\\\\Ldap\\\\LdapConnection\\:\\:ldapSearch\\(\\) has parameter \\$attributes with no value type specified in iterable type array\\.$#" + message: "#^Method Icinga\\\\Protocol\\\\Ldap\\\\LdapConnection\\:\\:getConnection\\(\\) has no return type specified\\.$#" count: 1 path: library/Icinga/Protocol/Ldap/LdapConnection.php - - message: "#^Method Icinga\\\\Protocol\\\\Ldap\\\\LdapConnection\\:\\:ldapSearch\\(\\) has parameter \\$controls with no value type specified in iterable type array\\.$#" + message: "#^Method Icinga\\\\Protocol\\\\Ldap\\\\LdapConnection\\:\\:ldapSearch\\(\\) has no return type specified\\.$#" count: 1 path: library/Icinga/Protocol/Ldap/LdapConnection.php - - message: "#^Method Icinga\\\\Protocol\\\\Ldap\\\\LdapConnection\\:\\:modifyEntry\\(\\) has parameter \\$attributes with no value type specified in iterable type array\\.$#" + message: "#^Method Icinga\\\\Protocol\\\\Ldap\\\\LdapConnection\\:\\:ldapSearch\\(\\) has parameter \\$attributes with no value type specified in iterable type array\\.$#" count: 1 path: library/Icinga/Protocol/Ldap/LdapConnection.php - - message: "#^Method Icinga\\\\Protocol\\\\Ldap\\\\LdapConnection\\:\\:moveEntry\\(\\) should return resource but returns true\\.$#" + message: "#^Method Icinga\\\\Protocol\\\\Ldap\\\\LdapConnection\\:\\:ldapSearch\\(\\) has parameter \\$controls with no value type specified in iterable type array\\.$#" count: 1 path: library/Icinga/Protocol/Ldap/LdapConnection.php - - message: "#^Method Icinga\\\\Protocol\\\\Ldap\\\\LdapConnection\\:\\:normalizeHostname\\(\\) has no return type specified\\.$#" + message: "#^Method Icinga\\\\Protocol\\\\Ldap\\\\LdapConnection\\:\\:modifyEntry\\(\\) has parameter \\$attributes with no value type specified in iterable type array\\.$#" count: 1 path: library/Icinga/Protocol/Ldap/LdapConnection.php - - message: "#^Method Icinga\\\\Protocol\\\\Ldap\\\\LdapConnection\\:\\:normalizeHostname\\(\\) has parameter \\$hostname with no type specified\\.$#" + message: "#^Method Icinga\\\\Protocol\\\\Ldap\\\\LdapConnection\\:\\:moveEntry\\(\\) should return resource but returns true\\.$#" + count: 1 + path: library/Icinga/Protocol/Ldap/LdapConnection.php + + - + message: "#^Method Icinga\\\\Protocol\\\\Ldap\\\\LdapConnection\\:\\:prepareNewConnection\\(\\) has no return type specified\\.$#" count: 1 path: library/Icinga/Protocol/Ldap/LdapConnection.php @@ -10000,6 +10000,11 @@ parameters: count: 1 path: library/Icinga/Protocol/Ldap/LdapConnection.php + - + message: "#^Property Icinga\\\\Protocol\\\\Ldap\\\\LdapConnection\\:\\:\\$ds has no type specified\\.$#" + count: 1 + path: library/Icinga/Protocol/Ldap/LdapConnection.php + - message: "#^Property Icinga\\\\Protocol\\\\Ldap\\\\LdapConnection\\:\\:\\$encryption \\(string\\) does not accept mixed\\.$#" count: 1 diff --git a/phpstan.neon b/phpstan.neon index 8126806a813..05a6c084b41 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -1,5 +1,6 @@ includes: - - phpstan-baseline.neon + - phpstan-baseline-standard.neon + - phpstan-baseline-by-php-version.php parameters: level: max @@ -28,29 +29,6 @@ parameters: - '#. but return statement is missing#' - '#Cannot call method importNode\(\) on DOMDocument\|null.#' - # ldap_connect() returns `LDAP\Connection` in php >= 81 - - - message: '#Parameter .* of function .* expects .*, .* given#' - count: 7 - path: library/Icinga/Protocol/Ldap/LdapCapabilities.php - - - - message: '#Parameter .* of (function|callable) .* expects .*, .* given#' - count: 75 - path: library/Icinga/Protocol/Ldap/LdapConnection.php - - - - message: '#Method Icinga\\Protocol\\Ldap\\LdapConnection::(prepareNewConnection|ldapSearch)\(\) should return (resource|bool\|resource) but returns (LDAP\\Connection\|false|array\|LDAP\\Result\|false)#' - count: 3 - path: library/Icinga/Protocol/Ldap/LdapConnection.php - - - - message: "#Cannot access offset ('count'|'dn') on array.*#" - count: 2 - path: library/Icinga/Protocol/Ldap/LdapConnection.php - - - '#Call to an undefined method ipl\\Sql\\Connection::exec\(\)#' - scanDirectories: - /usr/share/icinga-php - /usr/share/icingaweb2-modules