From 89ff4c699c54479da87bcae0d61af52d4219ddf2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Wed, 11 Mar 2009 03:27:28 +0000 Subject: [PATCH] All filters rewritten to throw FilterChainException --- .../ship-simu/main/filter/page/class_RefillPageFilter.php | 3 ++- .../filter/validator/class_RefillRequestValidatorFilter.php | 3 ++- .../main/filter/verifier/class_BirthdayVerifierFilter.php | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/application/ship-simu/main/filter/page/class_RefillPageFilter.php b/application/ship-simu/main/filter/page/class_RefillPageFilter.php index 1f3d3e8..f77af3f 100644 --- a/application/ship-simu/main/filter/page/class_RefillPageFilter.php +++ b/application/ship-simu/main/filter/page/class_RefillPageFilter.php @@ -51,6 +51,7 @@ class RefillPageFilter extends BaseShipSimuFilter implements Filterable { * @param $requestInstance An instance of a class with an Requestable interface * @param $responseInstance An instance of a class with an Responseable interface * @return void + * @throws FilterChainException If this filter fails to operate */ public function execute (Requestable $requestInstance, Responseable $responseInstance) { // Execute the parent execute method @@ -65,7 +66,7 @@ class RefillPageFilter extends BaseShipSimuFilter implements Filterable { $responseInstance->addFatalMessage('refill_page_not_active'); // Abort here - return false; + throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED); } // END - if } } diff --git a/application/ship-simu/main/filter/validator/class_RefillRequestValidatorFilter.php b/application/ship-simu/main/filter/validator/class_RefillRequestValidatorFilter.php index 1476a3e..f5ca9e0 100644 --- a/application/ship-simu/main/filter/validator/class_RefillRequestValidatorFilter.php +++ b/application/ship-simu/main/filter/validator/class_RefillRequestValidatorFilter.php @@ -52,6 +52,7 @@ class RefillRequestValidatorFilter extends BaseShipSimuFilter implements Filtera * @param $responseInstance An instance of a class with an Responseable interface * @return void * @todo Maybe we need to added some more generic tests on the request here? + * @throws FilterChainException If this filter fails to operate */ public function execute (Requestable $requestInstance, Responseable $responseInstance) { // Execute the parent execute method @@ -66,7 +67,7 @@ class RefillRequestValidatorFilter extends BaseShipSimuFilter implements Filtera $responseInstance->addFatalMessage('refill_page_required_fields_missing'); // Abort here - return false; + throw new FilterChainException($this, self::EXCEPTION_FILTER_CHAIN_INTERCEPTED); } // END - if } } diff --git a/application/ship-simu/main/filter/verifier/class_BirthdayVerifierFilter.php b/application/ship-simu/main/filter/verifier/class_BirthdayVerifierFilter.php index db5a026..688f357 100644 --- a/application/ship-simu/main/filter/verifier/class_BirthdayVerifierFilter.php +++ b/application/ship-simu/main/filter/verifier/class_BirthdayVerifierFilter.php @@ -58,6 +58,7 @@ class BirthdayVerifierFilter extends BaseShipSimuFilter implements Filterable { parent::execute($requestInstance, $responseInstance); // Implement this! + $requestInstance->debugInstance(); $this->partialStub("Please implement this method."); } } -- 2.39.5