From 543d29dea85a50e2d21b0d56cdb028a94795702c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sat, 20 Dec 2008 22:53:31 +0000 Subject: [PATCH] Missing filter class added for refill page, some minor rewrites --- .gitattributes | 2 + .../web/class_WebShipsimuRefillCommand.php | 4 +- .../ship-simu/main/filter/book/.htaccess | 1 + .../class_RefillRequestCurrencyBookFilter.php | 65 +++++++++++++++++++ application/ship-simu/main/filter/class_ | 2 +- .../main/filter/class_BaseShipSimuFilter.php | 2 +- .../class_RefillRequestValidatorFilter.php | 7 +- 7 files changed, 74 insertions(+), 9 deletions(-) create mode 100644 application/ship-simu/main/filter/book/.htaccess create mode 100644 application/ship-simu/main/filter/book/class_RefillRequestCurrencyBookFilter.php diff --git a/.gitattributes b/.gitattributes index 296d56e..8ab3108 100644 --- a/.gitattributes +++ b/.gitattributes @@ -116,6 +116,8 @@ application/ship-simu/main/drives/motor/class_Motor.php -text application/ship-simu/main/factories/.htaccess -text application/ship-simu/main/factories/class_ShipSimuWebNewsFactory.php -text application/ship-simu/main/filter/.htaccess -text +application/ship-simu/main/filter/book/.htaccess -text +application/ship-simu/main/filter/book/class_RefillRequestCurrencyBookFilter.php -text application/ship-simu/main/filter/class_ -text application/ship-simu/main/filter/class_BaseShipSimuFilter.php -text application/ship-simu/main/filter/government/.htaccess -text diff --git a/application/ship-simu/main/commands/web/class_WebShipsimuRefillCommand.php b/application/ship-simu/main/commands/web/class_WebShipsimuRefillCommand.php index cca8a18..fb7bd40 100644 --- a/application/ship-simu/main/commands/web/class_WebShipsimuRefillCommand.php +++ b/application/ship-simu/main/commands/web/class_WebShipsimuRefillCommand.php @@ -59,10 +59,10 @@ class WebShipsimuRefillCommand extends BaseCommand implements Commandable { * @param $requestInstance An instance of a class with an Requestable interface * @param $responseInstance An instance of a class with an Responseable interface * @return void - * @todo 0% done + * @todo We should add something like payment discovery here (where to withdraw, e.g. external API) */ public function execute (Requestable $requestInstance, Responseable $responseInstance) { - $this->partialStub("Please implement this method."); + // Unfinished method } /** diff --git a/application/ship-simu/main/filter/book/.htaccess b/application/ship-simu/main/filter/book/.htaccess new file mode 100644 index 0000000..3a42882 --- /dev/null +++ b/application/ship-simu/main/filter/book/.htaccess @@ -0,0 +1 @@ +Deny from all diff --git a/application/ship-simu/main/filter/book/class_RefillRequestCurrencyBookFilter.php b/application/ship-simu/main/filter/book/class_RefillRequestCurrencyBookFilter.php new file mode 100644 index 0000000..7101a82 --- /dev/null +++ b/application/ship-simu/main/filter/book/class_RefillRequestCurrencyBookFilter.php @@ -0,0 +1,65 @@ + + * @version 0.0.0 + * @copyright Copyright (c) 2007, 2008 Roland Haeder, this is free software + * @license GNU GPL 3.0 or any newer version + * @link http://www.ship-simu.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +class RefillRequestCurrencyBookFilter extends BaseShipSimuFilter implements Filterable { + /** + * Protected constructor + * + * @return void + */ + protected function __construct () { + // Call parent constructor + parent::__construct(__CLASS__); + } + + /** + * Creates an instance of this filter class + * + * @return $filterInstance An instance of this filter class + */ + public final static function createRefillRequestCurrencyBookFilter () { + // Get a new instance + $filterInstance = new RefillRequestCurrencyBookFilter(); + + // Return the instance + return $filterInstance; + } + + /** + * Executes the filter with given request and response objects + * + * @param $requestInstance An instance of a class with an Requestable interface + * @param $responseInstance An instance of a class with an Responseable interface + * @return void + * @todo Add code being executed in this filter + */ + public function execute (Requestable $requestInstance, Responseable $responseInstance) { + // Execute the parent execute method + parent::execute($requestInstance, $responseInstance); + + $this->partialStub("Add code here for your specific filter."); + } +} + +// [EOF] +?> diff --git a/application/ship-simu/main/filter/class_ b/application/ship-simu/main/filter/class_ index 6a0bb77..8fec98a 100644 --- a/application/ship-simu/main/filter/class_ +++ b/application/ship-simu/main/filter/class_ @@ -35,7 +35,7 @@ class ???Filter extends BaseShipSimuFilter implements Filterable { /** * Creates an instance of this filter class * - * @return $filterInstance An instance of this filter class + * @return $filterInstance An instance of this filter class */ public final static function create???Filter () { // Get a new instance diff --git a/application/ship-simu/main/filter/class_BaseShipSimuFilter.php b/application/ship-simu/main/filter/class_BaseShipSimuFilter.php index 6cc2830..5046c0e 100644 --- a/application/ship-simu/main/filter/class_BaseShipSimuFilter.php +++ b/application/ship-simu/main/filter/class_BaseShipSimuFilter.php @@ -39,7 +39,7 @@ class BaseShipSimuFilter extends BaseFilter { * @param $requestInstance An instance of a class with an Requestable interface * @param $responseInstance An instance of a class with an Responseable interface * @return void - * @todo 0% + * @todo Add something to do on every filter */ public function execute (Requestable $requestInstance, Responseable $responseInstance) { // Add something to do on every filter diff --git a/application/ship-simu/main/filter/validator/class_RefillRequestValidatorFilter.php b/application/ship-simu/main/filter/validator/class_RefillRequestValidatorFilter.php index 43dc7c6..1476a3e 100644 --- a/application/ship-simu/main/filter/validator/class_RefillRequestValidatorFilter.php +++ b/application/ship-simu/main/filter/validator/class_RefillRequestValidatorFilter.php @@ -35,7 +35,7 @@ class RefillRequestValidatorFilter extends BaseShipSimuFilter implements Filtera /** * Creates an instance of this filter class * - * @return $filterInstance An instance of this filter class + * @return $filterInstance An instance of this filter class */ public final static function createRefillRequestValidatorFilter () { // Get a new instance @@ -51,7 +51,7 @@ class RefillRequestValidatorFilter extends BaseShipSimuFilter implements Filtera * @param $requestInstance An instance of a class with an Requestable interface * @param $responseInstance An instance of a class with an Responseable interface * @return void - * @todo 0% done + * @todo Maybe we need to added some more generic tests on the request here? */ public function execute (Requestable $requestInstance, Responseable $responseInstance) { // Execute the parent execute method @@ -68,9 +68,6 @@ class RefillRequestValidatorFilter extends BaseShipSimuFilter implements Filtera // Abort here return false; } // END - if - - // Unfinised part - $this->partialStub("Unfinished method."); } } -- 2.30.2