]> git.mxchange.org Git - core.git/blobdiff - framework/main/classes/filter/class_FilterChain.php
Continued:
[core.git] / framework / main / classes / filter / class_FilterChain.php
index 9a91b2559ffd1e66c796bb023a5ce8f0eca0174e..a58bfef5872814cd06d0c7b30413ef04e208e23e 100644 (file)
@@ -15,7 +15,7 @@ use Org\Mxchange\CoreFramework\Response\Responseable;
  *
  * @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 - 2023 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -38,7 +38,7 @@ class FilterChain extends BaseFrameworkSystem implements Registerable {
         *
         * @return      void
         */
-       protected function __construct () {
+       private function __construct () {
                // Call parent constructor
                parent::__construct(__CLASS__);
        }
@@ -89,7 +89,7 @@ class FilterChain extends BaseFrameworkSystem implements Registerable {
                if ($this->isValidGenericArrayKey('filters', 'generic', 'dummy')) {
                        // Then get them
                        $filters = $this->getGenericArrayKey('filters', 'generic', 'dummy');
-               } // END - if
+               }
 
                // Return it
                return $filters;
@@ -108,7 +108,7 @@ class FilterChain extends BaseFrameworkSystem implements Registerable {
                if ($this->isValidGenericArrayKey('filters', 'post', 'dummy')) {
                        // Then get them
                        $filters = $this->getGenericArrayKey('filters', 'post', 'dummy');
-               } // END - if
+               }
 
                // Return it
                return $filters;
@@ -124,19 +124,22 @@ class FilterChain extends BaseFrameworkSystem implements Registerable {
         */
        public function processFilters (Requestable $requestInstance, Responseable $responseInstance) {
                // Run all filters
-               //* DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('COUNT=' . $this->countGenericArray('filters'));
+               //* DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage('COUNT=' . $this->countGenericArray('filters'));
                foreach ($this->getFilters() as $filterInstance) {
                        // Try to execute this filter
                        try {
-                               //* DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('FILTER: ' . $filterInstance->__toString() . ': Processing started.');
+                               //* DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage('FILTER: ' . $filterInstance->__toString() . ': Processing started.');
                                $filterInstance->execute($requestInstance, $responseInstance);
-                               //* DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('FILTER: ' . $filterInstance->__toString() . ': Processing ended.');
+                               //* DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage('FILTER: ' . $filterInstance->__toString() . ': Processing ended.');
                        } catch (FilterChainException $e) {
                                // This exception can be thrown to just skip any further processing
-                               self::createDebugInstance(__CLASS__, __LINE__)->debugOutput('Failed to execute lase filter ' . $filterInstance->__toString() . ': ' . $e->getMessage());
+                               self::createDebugInstance(__CLASS__, __LINE__)->warningMessage('Failed to execute lase filter ' . $filterInstance->__toString() . ': ' . $e->getMessage());
                                break;
                        }
                }
+
+               // Trace message
+               /* DEBUG */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage('EXIT!');
        }
 
 }