From 8b2b648b1ae5d6e5f3d3bafd3d1f37c870732dac Mon Sep 17 00:00:00 2001 From: Josef Stich Date: Tue, 28 May 2024 15:21:24 +0200 Subject: [PATCH] use exceptions instead of trigger_error #3 --- Controller/Component/FilterComponent.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Controller/Component/FilterComponent.php b/Controller/Component/FilterComponent.php index 81413b7..81d9024 100644 --- a/Controller/Component/FilterComponent.php +++ b/Controller/Component/FilterComponent.php @@ -78,7 +78,7 @@ public function initialize(Controller $controller): void if (!isset($controller->{$model})) { $errMsg = __('Filter model not found: %s', $model); if (is_string($errMsg)) { - trigger_error($errMsg); + throw new InvalidArgumentException($errMsg); } continue; } @@ -130,7 +130,7 @@ public function startup(Controller $controller) if (!isset($controller->{$model})) { $errMsg = __('Filter model not found: %s', $model); if (is_string($errMsg)) { - trigger_error($errMsg); + throw new InvalidArgumentException($errMsg); } continue; }