From 41f18bcd69bd0393c8b29c0ef5c430de9c1ce319 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivan=20Ruz=CC=8Cevic=CC=81?= Date: Mon, 9 Dec 2024 11:10:56 +0100 Subject: [PATCH] Fixing broken filter callbacks --- CHANGELOG.md | 7 +++++++ src/Helpers/UtilsDeveloperHelper.php | 18 +++++++++--------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 06ce366..22753f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file. This projects adheres to [Semantic Versioning](https://semver.org/) and [Keep a CHANGELOG](https://keepachangelog.com/). +## [3.0.10] + +### Fixed + +- Wrong filter callback for Debug options. + ## [3.0.9] ### Changed @@ -266,6 +272,7 @@ This projects adheres to [Semantic Versioning](https://semver.org/) and [Keep a - Initial production release. +[3.0.10]: https://github.com/infinum/eightshift-forms-utils/compare/3.0.9...3.0.10 [3.0.9]: https://github.com/infinum/eightshift-forms-utils/compare/3.0.8...3.0.9 [3.0.8]: https://github.com/infinum/eightshift-forms-utils/compare/3.0.7...3.0.8 [3.0.7]: https://github.com/infinum/eightshift-forms-utils/compare/3.0.6...3.0.7 diff --git a/src/Helpers/UtilsDeveloperHelper.php b/src/Helpers/UtilsDeveloperHelper.php index f774127..de326cd 100644 --- a/src/Helpers/UtilsDeveloperHelper.php +++ b/src/Helpers/UtilsDeveloperHelper.php @@ -24,7 +24,7 @@ final class UtilsDeveloperHelper */ public static function isDeveloperDebuggingActive(): bool { - return \apply_filters(UtilsConfig::FILTER_SETTINGS_IS_DEBUG_ACTIVE, UtilsConfig::SETTINGS_DEBUG_DEBUGGING_KEY) ?? false; + return \apply_filters(UtilsConfig::FILTER_SETTINGS_IS_DEBUG_ACTIVE, false, UtilsConfig::SETTINGS_DEBUG_DEBUGGING_KEY); } /** @@ -34,7 +34,7 @@ public static function isDeveloperDebuggingActive(): bool */ public static function isDeveloperSkipFormValidationActive(): bool { - return \apply_filters(UtilsConfig::FILTER_SETTINGS_IS_DEBUG_ACTIVE, UtilsConfig::SETTINGS_DEBUG_SKIP_VALIDATION_KEY) ?? false; + return \apply_filters(UtilsConfig::FILTER_SETTINGS_IS_DEBUG_ACTIVE, false, UtilsConfig::SETTINGS_DEBUG_SKIP_VALIDATION_KEY); } /** @@ -44,7 +44,7 @@ public static function isDeveloperSkipFormValidationActive(): bool */ public static function isDeveloperSkipFormResetActive(): bool { - return \apply_filters(UtilsConfig::FILTER_SETTINGS_IS_DEBUG_ACTIVE, UtilsConfig::SETTINGS_DEBUG_SKIP_RESET_KEY) ?? false; + return \apply_filters(UtilsConfig::FILTER_SETTINGS_IS_DEBUG_ACTIVE, false, UtilsConfig::SETTINGS_DEBUG_SKIP_RESET_KEY); } /** @@ -54,7 +54,7 @@ public static function isDeveloperSkipFormResetActive(): bool */ public static function isDeveloperSkipCaptchaActive(): bool { - return \apply_filters(UtilsConfig::FILTER_SETTINGS_IS_DEBUG_ACTIVE, UtilsConfig::SETTINGS_DEBUG_SKIP_CAPTCHA_KEY) ?? false; + return \apply_filters(UtilsConfig::FILTER_SETTINGS_IS_DEBUG_ACTIVE, false, UtilsConfig::SETTINGS_DEBUG_SKIP_CAPTCHA_KEY); } /** @@ -64,7 +64,7 @@ public static function isDeveloperSkipCaptchaActive(): bool */ public static function isDeveloperSkipFormsSyncActive(): bool { - return \apply_filters(UtilsConfig::FILTER_SETTINGS_IS_DEBUG_ACTIVE, UtilsConfig::SETTINGS_DEBUG_SKIP_FORMS_SYNC_KEY) ?? false; + return \apply_filters(UtilsConfig::FILTER_SETTINGS_IS_DEBUG_ACTIVE, false, UtilsConfig::SETTINGS_DEBUG_SKIP_FORMS_SYNC_KEY); } /** @@ -74,7 +74,7 @@ public static function isDeveloperSkipFormsSyncActive(): bool */ public static function isDeveloperSkipCacheActive(): bool { - return \apply_filters(UtilsConfig::FILTER_SETTINGS_IS_DEBUG_ACTIVE, UtilsConfig::SETTINGS_DEBUG_SKIP_CACHE_KEY) ?? false; + return \apply_filters(UtilsConfig::FILTER_SETTINGS_IS_DEBUG_ACTIVE, false, UtilsConfig::SETTINGS_DEBUG_SKIP_CACHE_KEY); } /** @@ -84,7 +84,7 @@ public static function isDeveloperSkipCacheActive(): bool */ public static function isDeveloperModeActive(): bool { - return \apply_filters(UtilsConfig::FILTER_SETTINGS_IS_DEBUG_ACTIVE, UtilsConfig::SETTINGS_DEBUG_DEVELOPER_MODE_KEY) ?? false; + return \apply_filters(UtilsConfig::FILTER_SETTINGS_IS_DEBUG_ACTIVE, false, UtilsConfig::SETTINGS_DEBUG_DEVELOPER_MODE_KEY); } /** @@ -94,7 +94,7 @@ public static function isDeveloperModeActive(): bool */ public static function isDeveloperQMLogActive(): bool { - return \apply_filters(UtilsConfig::FILTER_SETTINGS_IS_DEBUG_ACTIVE, UtilsConfig::SETTINGS_DEBUG_QM_LOG) ?? false; + return \apply_filters(UtilsConfig::FILTER_SETTINGS_IS_DEBUG_ACTIVE, false, UtilsConfig::SETTINGS_DEBUG_QM_LOG); } /** @@ -104,7 +104,7 @@ public static function isDeveloperQMLogActive(): bool */ public static function isDeveloperForceDisabledFieldsActive(): bool { - return \apply_filters(UtilsConfig::FILTER_SETTINGS_IS_DEBUG_ACTIVE, UtilsConfig::SETTINGS_DEBUG_FORCE_DISABLED_FIELDS) ?? false; + return \apply_filters(UtilsConfig::FILTER_SETTINGS_IS_DEBUG_ACTIVE, false, UtilsConfig::SETTINGS_DEBUG_FORCE_DISABLED_FIELDS); } /**