diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 8f6fded6..72243a02 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -430,20 +430,6 @@ parameters: count: 1 path: compat/src-deprecated/functions.php - - - message: "#^Function notification_add_doc_hooks\\(\\) should return object but returns mixed\\.$#" - count: 1 - path: compat/src-deprecated/functions.php - - - - message: "#^Function notification_get_notification_recipients\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: compat/src-deprecated/functions.php - - - - message: "#^Function notification_get_notifications\\(\\) return type has no value type specified in iterable type array\\.$#" - count: 1 - path: compat/src-deprecated/functions.php - message: "#^Function notification_get_posts\\(\\) return type has no value type specified in iterable type array\\.$#" @@ -460,11 +446,6 @@ parameters: count: 1 path: compat/src-deprecated/functions.php - - - message: "#^Function notification_runtime\\(\\) should return object but returns mixed\\.$#" - count: 1 - path: compat/src-deprecated/functions.php - - message: "#^Function notification_template\\(\\) has parameter \\$vars with no value type specified in iterable type array\\.$#" count: 1 @@ -495,11 +476,6 @@ parameters: count: 4 path: notification.php - - - message: "#^Parameter \\#1 \\$function of function call_user_func_array expects callable\\(\\)\\: mixed, array\\{BracketSpace\\\\Notification\\\\Core\\\\Notification, string\\} given\\.$#" - count: 1 - path: src/Abstracts/Adapter.php - - message: "#^Argument of an invalid type mixed supplied for foreach, only iterables are supported\\.$#" count: 1 @@ -545,11 +521,6 @@ parameters: count: 1 path: src/Abstracts/Carrier.php - - - message: "#^Parameter \\#1 \\$str of function md5 expects string, string\\|false given\\.$#" - count: 1 - path: src/Abstracts/Carrier.php - - message: "#^Parameter \\#2 \\$slug of static method BracketSpace\\\\Notification\\\\Store\\\\Recipient\\:\\:get\\(\\) expects string, mixed given\\.$#" count: 1 @@ -605,11 +576,6 @@ parameters: count: 1 path: src/Abstracts/Trigger.php - - - message: "#^Method BracketSpace\\\\Notification\\\\Abstracts\\\\Trigger\\:\\:getMergeTags\\(\\) should return array\\ but returns array\\\\.$#" - count: 1 - path: src/Abstracts/Trigger.php - - message: "#^Cannot call method getEndpoint\\(\\) on mixed\\.$#" count: 1 @@ -632,7 +598,7 @@ parameters: - message: "#^Cannot access offset 'edd' on mixed\\.$#" - count: 5 + count: 2 path: src/Admin/Extensions.php - @@ -642,7 +608,7 @@ parameters: - message: "#^Cannot access offset 'slug' on mixed\\.$#" - count: 5 + count: 3 path: src/Admin/Extensions.php - @@ -710,21 +676,6 @@ parameters: count: 1 path: src/Admin/ImportExport.php - - - message: "#^Parameter \\#1 \\$fp of function fclose expects resource, resource\\|false given\\.$#" - count: 1 - path: src/Admin/ImportExport.php - - - - message: "#^Parameter \\#1 \\$fp of function fread expects resource, resource\\|false given\\.$#" - count: 1 - path: src/Admin/ImportExport.php - - - - message: "#^Parameter \\#1 \\$function of function call_user_func expects callable\\(\\)\\: mixed, array\\{\\$this\\(BracketSpace\\\\Notification\\\\Admin\\\\ImportExport\\), non\\-falsy\\-string\\} given\\.$#" - count: 2 - path: src/Admin/ImportExport.php - - message: "#^Parameter \\#1 \\$json of function json_decode expects string, mixed given\\.$#" count: 1 @@ -780,11 +731,6 @@ parameters: count: 1 path: src/Admin/PostTable.php - - - message: "#^Parameter \\#1 \\$url of function esc_url expects string, string\\|void given\\.$#" - count: 1 - path: src/Admin/PostTable.php - - message: "#^Method BracketSpace\\\\Notification\\\\Admin\\\\PostType\\:\\:getAllNotifications\\(\\) should return array but returns mixed\\.$#" count: 1 @@ -870,11 +816,6 @@ parameters: count: 1 path: src/Admin/Scripts.php - - - message: "#^Parameter \\#1 \\$function of function call_user_func expects callable\\(\\)\\: mixed, array\\{\\$this\\(BracketSpace\\\\Notification\\\\Admin\\\\Sync\\), non\\-falsy\\-string\\} given\\.$#" - count: 1 - path: src/Admin/Sync.php - - message: "#^Offset 'draft' on array\\{publish\\: int, draft\\: int\\} on left side of \\?\\? always exists and is not nullable\\.$#" count: 1 @@ -1035,16 +976,6 @@ parameters: count: 1 path: src/Api/Controller/RepeaterController.php - - - message: "#^Parameter \\#1 \\$var of function intval expects array\\|bool\\|float\\|int\\|resource\\|string\\|null, mixed given\\.$#" - count: 1 - path: src/Api/Controller/RepeaterController.php - - - - message: "#^Parameter \\#2 \\$search of function array_key_exists expects array, mixed given\\.$#" - count: 1 - path: src/Api/Controller/RepeaterController.php - - message: "#^Property BracketSpace\\\\Notification\\\\Api\\\\Controller\\\\RepeaterController\\:\\:\\$carrier \\(string\\) does not accept mixed\\.$#" count: 1 @@ -1077,7 +1008,7 @@ parameters: - message: "#^Cannot access offset 'sections' on mixed\\.$#" - count: 2 + count: 1 path: src/Api/Controller/SectionRepeaterController.php - @@ -1185,11 +1116,6 @@ parameters: count: 1 path: src/Core/License.php - - - message: "#^Parameter \\#1 \\$str of function rawurlencode expects string, mixed given\\.$#" - count: 3 - path: src/Core/License.php - - message: "#^Parameter \\#1 \\$url of function wp_remote_post expects string, mixed given\\.$#" count: 3 @@ -1265,16 +1191,6 @@ parameters: count: 1 path: src/Core/Resolver.php - - - message: "#^Parameter \\#2 \\$callback of function preg_replace_callback expects callable\\(array\\\\)\\: string, Closure\\(mixed\\)\\: mixed given\\.$#" - count: 1 - path: src/Core/Resolver.php - - - - message: "#^Parameter \\#3 \\$subject of function preg_replace_callback expects array\\|string, string\\|null given\\.$#" - count: 1 - path: src/Core/Resolver.php - - message: "#^Parameter \\#2 \\$contents of method WP_Filesystem_Base\\:\\:put_contents\\(\\) expects string, mixed given\\.$#" count: 1 @@ -1305,16 +1221,6 @@ parameters: count: 1 path: src/Core/Upgrade.php - - - message: "#^Parameter \\#1 \\$function of function call_user_func expects callable\\(\\)\\: mixed, array\\{\\$this\\(BracketSpace\\\\Notification\\\\Core\\\\Upgrade\\), non\\-falsy\\-string\\} given\\.$#" - count: 1 - path: src/Core/Upgrade.php - - - - message: "#^Parameter \\#1 \\$index of static method BracketSpace\\\\Notification\\\\Store\\\\Trigger\\:\\:get\\(\\) expects string, mixed given\\.$#" - count: 1 - path: src/Core/Upgrade.php - - message: "#^Parameter \\#3 \\$subject of function preg_replace expects array\\|string, mixed given\\.$#" count: 1 @@ -1325,11 +1231,6 @@ parameters: count: 1 path: src/Core/Upgrade.php - - - message: "#^Parameter \\#1 \\$data of function notificationConvertData expects array, mixed given\\.$#" - count: 1 - path: src/Defaults/Adapter/JSON.php - - message: "#^Parameter \\#1 \\$json of function json_decode expects string, string\\|null given\\.$#" count: 1 @@ -1367,7 +1268,7 @@ parameters: - message: "#^Cannot access offset 'hide' on mixed\\.$#" - count: 2 + count: 1 path: src/Defaults/Carrier/Webhook.php - @@ -1387,7 +1288,7 @@ parameters: - message: "#^Cannot access offset 'hide' on mixed\\.$#" - count: 2 + count: 1 path: src/Defaults/Carrier/WebhookJson.php - @@ -1405,11 +1306,6 @@ parameters: count: 1 path: src/Defaults/Carrier/WebhookJson.php - - - message: "#^Parameter \\#1 \\$text of function esc_attr expects string, mixed given\\.$#" - count: 1 - path: src/Defaults/Field/CodeEditorField.php - - message: "#^Parameter \\#1 \\$text of function esc_attr expects string, string\\|false given\\.$#" count: 1 @@ -1470,11 +1366,6 @@ parameters: count: 1 path: src/Defaults/Field/ImageField.php - - - message: "#^Parameter \\#1 \\$var of function intval expects array\\|bool\\|float\\|int\\|resource\\|string\\|null, mixed given\\.$#" - count: 1 - path: src/Defaults/Field/ImageField.php - - message: "#^Cannot cast mixed to string\\.$#" count: 1 @@ -1517,7 +1408,7 @@ parameters: - message: "#^Cannot access offset string on mixed\\.$#" - count: 2 + count: 1 path: src/Defaults/Field/RepeaterField.php - @@ -1530,11 +1421,6 @@ parameters: count: 1 path: src/Defaults/Field/RepeaterField.php - - - message: "#^Parameter \\#1 \\$input of function array_keys expects array, mixed given\\.$#" - count: 1 - path: src/Defaults/Field/SectionRepeater.php - - message: "#^Parameter \\#1 \\$text of function esc_attr expects string, mixed given\\.$#" count: 1 @@ -1545,11 +1431,6 @@ parameters: count: 1 path: src/Defaults/Field/SectionRepeater.php - - - message: "#^Parameter \\#1 \\$var of function count expects array\\|Countable, mixed given\\.$#" - count: 1 - path: src/Defaults/Field/SectionRepeater.php - - message: "#^Property BracketSpace\\\\Notification\\\\Defaults\\\\Field\\\\SectionRepeater\\:\\:\\$sections \\(array\\) does not accept mixed\\.$#" count: 1 @@ -1655,11 +1536,6 @@ parameters: count: 1 path: src/Defaults/MergeTag/EmailTag.php - - - message: "#^Parameter \\#1 \\$var of function floatval expects array\\|bool\\|float\\|int\\|resource\\|string\\|null, mixed given\\.$#" - count: 1 - path: src/Defaults/MergeTag/FloatTag.php - - message: "#^Cannot cast mixed to string\\.$#" count: 1 @@ -1670,11 +1546,6 @@ parameters: count: 1 path: src/Defaults/MergeTag/IntegerTag.php - - - message: "#^Parameter \\#1 \\$var of function intval expects array\\|bool\\|float\\|int\\|resource\\|string\\|null, mixed given\\.$#" - count: 1 - path: src/Defaults/MergeTag/IntegerTag.php - - message: "#^Parameter \\#1 \\$triggerPropertyName of method BracketSpace\\\\Notification\\\\Abstracts\\\\MergeTag\\:\\:setTriggerProp\\(\\) expects string, mixed given\\.$#" count: 1 @@ -2025,56 +1896,26 @@ parameters: count: 1 path: src/Defaults/Trigger/Media/MediaUpdated.php - - - message: "#^Access to an undefined property object\\:\\:\\$post_status\\.$#" - count: 1 - path: src/Defaults/Trigger/Post/PostAdded.php - - - - message: "#^Access to an undefined property object\\:\\:\\$post_type\\.$#" - count: 1 - path: src/Defaults/Trigger/Post/PostAdded.php - - message: "#^Cannot cast mixed to int\\.$#" count: 1 path: src/Defaults/Trigger/Post/PostAdded.php - - - message: "#^Access to an undefined property object\\:\\:\\$post_type\\.$#" - count: 1 - path: src/Defaults/Trigger/Post/PostApproved.php - - message: "#^Cannot cast mixed to int\\.$#" count: 1 path: src/Defaults/Trigger/Post/PostApproved.php - - - message: "#^Access to an undefined property object\\:\\:\\$post_type\\.$#" - count: 1 - path: src/Defaults/Trigger/Post/PostDrafted.php - - message: "#^Cannot cast mixed to int\\.$#" count: 1 path: src/Defaults/Trigger/Post/PostDrafted.php - - - message: "#^Access to an undefined property object\\:\\:\\$post_type\\.$#" - count: 1 - path: src/Defaults/Trigger/Post/PostPending.php - - message: "#^Cannot cast mixed to int\\.$#" count: 1 path: src/Defaults/Trigger/Post/PostPending.php - - - message: "#^Access to an undefined property object\\:\\:\\$post_type\\.$#" - count: 1 - path: src/Defaults/Trigger/Post/PostPublished.php - - message: "#^Cannot cast mixed to int\\.$#" count: 1 @@ -2085,21 +1926,11 @@ parameters: count: 1 path: src/Defaults/Trigger/Post/PostPublishedPrivately.php - - - message: "#^Access to an undefined property object\\:\\:\\$post_type\\.$#" - count: 1 - path: src/Defaults/Trigger/Post/PostScheduled.php - - message: "#^Cannot cast mixed to int\\.$#" count: 1 path: src/Defaults/Trigger/Post/PostScheduled.php - - - message: "#^Access to an undefined property object\\:\\:\\$post_type\\.$#" - count: 1 - path: src/Defaults/Trigger/Post/PostTrashed.php - - message: "#^Cannot cast mixed to int\\.$#" count: 1 @@ -2270,16 +2101,6 @@ parameters: count: 1 path: src/Defaults/Trigger/WordPress/UpdatesAvailable.php - - - message: "#^Argument of an invalid type mixed supplied for foreach, only iterables are supported\\.$#" - count: 1 - path: src/Defaults/Trigger/WordPress/UpdatesAvailable.php - - - - message: "#^Cannot access offset mixed on mixed\\.$#" - count: 1 - path: src/Defaults/Trigger/WordPress/UpdatesAvailable.php - - message: "#^Cannot access property \\$current on mixed\\.$#" count: 1 @@ -2290,16 +2111,6 @@ parameters: count: 1 path: src/Defaults/Trigger/WordPress/UpdatesAvailable.php - - - message: "#^Parameter \\#1 \\$function of function call_user_func expects callable\\(\\)\\: mixed, array\\{mixed, non\\-falsy\\-string\\} given\\.$#" - count: 1 - path: src/Defaults/Trigger/WordPress/UpdatesAvailable.php - - - - message: "#^Parameter \\#1 \\$function of function call_user_func expects callable\\(\\)\\: mixed, non\\-falsy\\-string given\\.$#" - count: 1 - path: src/Defaults/Trigger/WordPress/UpdatesAvailable.php - - message: "#^Parameter \\#1 \\$updateType of method BracketSpace\\\\Notification\\\\Defaults\\\\Trigger\\\\WordPress\\\\UpdatesAvailable\\:\\:getUpdatesCount\\(\\) expects string, mixed given\\.$#" count: 1 @@ -2310,11 +2121,6 @@ parameters: count: 1 path: src/Defaults/Trigger/WordPress/UpdatesAvailable.php - - - message: "#^Parameter \\#1 \\$var of function count expects array\\|Countable, mixed given\\.$#" - count: 1 - path: src/Defaults/Trigger/WordPress/UpdatesAvailable.php - - message: "#^Invalid type object to throw\\.$#" count: 1 @@ -2325,16 +2131,6 @@ parameters: count: 2 path: src/Integration/WordPress.php - - - message: "#^Method BracketSpace\\\\Notification\\\\Integration\\\\WordPress\\:\\:filterEmailFromEmail\\(\\) should return string but returns mixed\\.$#" - count: 1 - path: src/Integration/WordPress.php - - - - message: "#^Method BracketSpace\\\\Notification\\\\Integration\\\\WordPress\\:\\:filterEmailFromName\\(\\) should return string but returns mixed\\.$#" - count: 1 - path: src/Integration/WordPress.php - - message: "#^Method BracketSpace\\\\Notification\\\\Integration\\\\WordPressEmails\\:\\:getSettingForUserRole\\(\\) is unused\\.$#" count: 1 @@ -2480,11 +2276,6 @@ parameters: count: 1 path: src/Store/Carrier.php - - - message: "#^Unsafe access to private property BracketSpace\\\\Notification\\\\Store\\\\Carrier\\:\\:\\$items through static\\:\\:\\.$#" - count: 6 - path: src/Store/Carrier.php - - message: "#^Parameter \\#1 \\$key of function array_key_exists expects int\\|string, mixed given\\.$#" count: 1 @@ -2495,11 +2286,6 @@ parameters: count: 1 path: src/Store/GlobalMergeTag.php - - - message: "#^Unsafe access to private property BracketSpace\\\\Notification\\\\Store\\\\GlobalMergeTag\\:\\:\\$items through static\\:\\:\\.$#" - count: 6 - path: src/Store/GlobalMergeTag.php - - message: "#^Cannot call method getTrigger\\(\\) on mixed\\.$#" count: 2 @@ -2520,11 +2306,6 @@ parameters: count: 1 path: src/Store/Notification.php - - - message: "#^Unsafe access to private property BracketSpace\\\\Notification\\\\Store\\\\Notification\\:\\:\\$items through static\\:\\:\\.$#" - count: 6 - path: src/Store/Notification.php - - message: "#^Cannot access offset string on mixed\\.$#" count: 1 @@ -2540,26 +2321,11 @@ parameters: count: 1 path: src/Store/Recipient.php - - - message: "#^Parameter \\#2 \\$search of function array_key_exists expects array, mixed given\\.$#" - count: 1 - path: src/Store/Recipient.php - - message: "#^Unsafe access to private property BracketSpace\\\\Notification\\\\Store\\\\Recipient\\:\\:\\$items through static\\:\\:\\.$#" count: 8 path: src/Store/Recipient.php - - - message: "#^Cannot call method getPriority\\(\\) on mixed\\.$#" - count: 4 - path: src/Store/Resolver.php - - - - message: "#^Method BracketSpace\\\\Notification\\\\Store\\\\Resolver\\:\\:sorted\\(\\) should return array\\ but returns array\\.$#" - count: 1 - path: src/Store/Resolver.php - - message: "#^Parameter \\#1 \\$key of function array_key_exists expects int\\|string, mixed given\\.$#" count: 1 @@ -2570,11 +2336,6 @@ parameters: count: 1 path: src/Store/Resolver.php - - - message: "#^Unsafe access to private property BracketSpace\\\\Notification\\\\Store\\\\Resolver\\:\\:\\$items through static\\:\\:\\.$#" - count: 6 - path: src/Store/Resolver.php - - message: "#^Parameter \\#1 \\$key of function array_key_exists expects int\\|string, mixed given\\.$#" count: 1 @@ -2585,11 +2346,6 @@ parameters: count: 1 path: src/Store/Trigger.php - - - message: "#^Unsafe access to private property BracketSpace\\\\Notification\\\\Store\\\\Trigger\\:\\:\\$items through static\\:\\:\\.$#" - count: 6 - path: src/Store/Trigger.php - - message: "#^Cannot access offset 'host' on array\\{scheme\\?\\: string, host\\?\\: string, port\\?\\: int, user\\?\\: string, pass\\?\\: string, path\\?\\: string, query\\?\\: string, fragment\\?\\: string\\}\\|false\\.$#" count: 1 @@ -2612,7 +2368,7 @@ parameters: - message: "#^Cannot access offset string on mixed\\.$#" - count: 5 + count: 3 path: src/Utils/Settings.php - @@ -2665,16 +2421,6 @@ parameters: count: 1 path: src/Utils/Settings/CoreFields/Select.php - - - message: "#^Method BracketSpace\\\\Notification\\\\Utils\\\\Settings\\\\Field\\:\\:sanitize\\(\\) should return string but returns mixed\\.$#" - count: 1 - path: src/Utils/Settings/Field.php - - - - message: "#^Parameter \\#1 \\$function of function call_user_func expects callable\\(\\)\\: mixed, mixed given\\.$#" - count: 2 - path: src/Utils/Settings/Field.php - - message: "#^Property BracketSpace\\\\Notification\\\\Utils\\\\Settings\\\\Field\\:\\:\\$addons \\(string\\) does not accept mixed\\.$#" count: 1 @@ -2765,16 +2511,6 @@ parameters: count: 1 path: src/api.php - - - message: "#^Function notificationAdapt\\(\\) should return BracketSpace\\\\Notification\\\\Interfaces\\\\Adaptable but returns object\\.$#" - count: 1 - path: src/api.php - - - - message: "#^Parameter \\#1 \\$index of static method BracketSpace\\\\Notification\\\\Store\\\\Trigger\\:\\:get\\(\\) expects string, mixed given\\.$#" - count: 1 - path: src/api.php - - message: "#^Argument of an invalid type mixed supplied for foreach, only iterables are supported\\.$#" count: 1 @@ -2787,17 +2523,17 @@ parameters: - message: "#^Cannot access offset 'licenses' on mixed\\.$#" - count: 2 + count: 1 path: uninstall.php - message: "#^Cannot access offset 'notifications' on mixed\\.$#" - count: 2 + count: 1 path: uninstall.php - message: "#^Cannot access offset 'settings' on mixed\\.$#" - count: 2 + count: 1 path: uninstall.php - diff --git a/phpstan.neon b/phpstan.neon index 515a03be..a0da15ea 100644 --- a/phpstan.neon +++ b/phpstan.neon @@ -4,7 +4,6 @@ includes: parameters: level: max inferPrivatePropertyTypeFromConstructor: true - reportUnmatchedIgnoredErrors: false scanFiles: - vendor/php-stubs/wp-cli-stubs/wp-cli-stubs.php paths: