// Import framework stuff
use Org\Mxchange\CoreFramework\Chain\Filter\InvalidFilterChainException;
-use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
+use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
use Org\Mxchange\CoreFramework\Filter\Filterable;
use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
*
* @author Roland Haeder <webmaster@shipsimu.org>
* @version 0.0.0
- * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2020 Core Developer Team
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2022 Core Developer Team
* @license GNU GPL 3.0 or any newer version
* @link http://www.shipsimu.org
*
$this->executePreFilters($requestInstance, $responseInstance);
// This request was valid! :-D
- $requestInstance->requestIsValid();
+ $requestInstance->setIsRequestValid(TRUE);
// Execute the command
$commandInstance->execute($requestInstance, $responseInstance);
// Execute *very* generic post filters
$this->executePostFilters($requestInstance, $responseInstance);
- } // END - if
+ }
// Flush the buffer out
$responseInstance->flushBuffer();
}
// This request was valid! :-D
- $requestInstance->requestIsValid();
+ $requestInstance->setIsRequestValid(TRUE);
// Execute the command
$commandInstance->execute($requestInstance, $responseInstance);
* @param $filterChain Name of the filter chain
* @return void
*/
- protected function initFilterChain ($filterChain) {
+ protected function initFilterChain (string $filterChain) {
//* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONTROLLER: ' . $filterChain . ' init: START');
$this->filterChains[$filterChain] = ObjectFactory::createObjectByConfiguredName('filter_chain_class');
//* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONTROLLER: ' . $filterChain . ' init: FINISHED');
* @return void
* @throws InvalidFilterChainException If the filter chain is invalid
*/
- protected function addFilter ($filterChain, Filterable $filterInstance) {
+ protected function addFilter (string $filterChain, Filterable $filterInstance) {
//* DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('CONTROLLER: ' . $filterChain . ',' . $filterInstance->__toString(). ' add: START');
// Test if the filter is there
if (!isset($this->filterChains[$filterChain])) {
// Throw an exception here
throw new InvalidFilterChainException(array($this, $filterChain), self::EXCEPTION_FILTER_CHAIN_INVALID);
- } // END - if
+ }
// Add the filter
$this->filterChains[$filterChain]->addFilter($filterInstance);
* @return void
* @throws InvalidFilterChainException If the filter chain is invalid
*/
- protected function executeFilters ($filterChain, Requestable $requestInstance, Responseable $responseInstance) {
+ protected function executeFilters (string $filterChain, Requestable $requestInstance, Responseable $responseInstance) {
// Test if the filter is there
if (!isset($this->filterChains[$filterChain])) {
// Throw an exception here
throw new InvalidFilterChainException(array($this, $filterChain), self::EXCEPTION_FILTER_CHAIN_INVALID);
- } // END - if
+ }
// Run all filters
$this->filterChains[$filterChain]->processFilters($requestInstance, $responseInstance);