]> git.mxchange.org Git - core.git/blobdiff - framework/main/classes/request/class_BaseRequest.php
Continued:
[core.git] / framework / main / classes / request / class_BaseRequest.php
index eaff2be05e1d65a5ca1b98eb970cb323c8052c4a..d52d9914823a661d27f9816a802a495116032d91 100644 (file)
@@ -1,16 +1,16 @@
 <?php
 // Own namespace
-namespace CoreFramework\Request;
+namespace Org\Mxchange\CoreFramework\Request;
 
 // Import framework stuff
-use CoreFramework\Object\BaseFrameworkSystem;
+use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
 
 /**
  * A general request class
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2017 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
  *
@@ -31,14 +31,14 @@ abstract class BaseRequest extends BaseFrameworkSystem {
        /**
         * Array for the request data
         */
-       private $requestData = array();
+       private $requestData = [];
 
        /**
         * Whether this request is valid and can be further processed. The default is
         * valid so make sure your intercepting filters sets this attribute to false
         * when they need to intercept the data flow.
         */
-       private $requestIsValid = true;
+       private $isRequestValid = true;
 
        /**
         * Protected constructor
@@ -46,7 +46,7 @@ abstract class BaseRequest extends BaseFrameworkSystem {
         * @param       $className      Name of the class
         * @return      void
         */
-       protected function __construct ($className) {
+       protected function __construct (string $className) {
                // Call parent constructor
                parent::__construct($className);
        }
@@ -56,7 +56,7 @@ abstract class BaseRequest extends BaseFrameworkSystem {
         * @param       $element        Name of the request element we want to check
         * @return      $isSet          Whether the request element is set
         */
-       public function isRequestElementSet ($element) {
+       public function isRequestElementSet (string $element) {
                // Is this element found?
                $isSet = isset($this->requestData[$element]);
 
@@ -71,7 +71,7 @@ abstract class BaseRequest extends BaseFrameworkSystem {
         * @return      $value          Value of the found request element or 'null' if the
         *                                              element was not found
         */
-       public function getRequestElement ($element) {
+       public function getRequestElement (string $element) {
                // Initialize value
                $value = NULL;
 
@@ -82,7 +82,7 @@ abstract class BaseRequest extends BaseFrameworkSystem {
 
                        // Secure it against attacks
                        $value = htmlentities(strip_tags($value), ENT_QUOTES);
-               } // END - if
+               }
 
                // Return the element's value
                return $value;
@@ -95,7 +95,7 @@ abstract class BaseRequest extends BaseFrameworkSystem {
         * @param       $value          Value to set
         * @return      void
         */
-       public function setRequestElement ($element, $value) {
+       public function setRequestElement (string $element, $value) {
                $this->requestData[$element] = $value;
        }
 
@@ -119,22 +119,22 @@ abstract class BaseRequest extends BaseFrameworkSystem {
        }
 
        /**
-        * Sets whether the request was valid (default: true)
+        * Sets whether the request was valid
         *
         * @param       $isValid        Whether the request is valid
         * @return      void
         */
-       public final function requestIsValid ($isValid = true) {
-               $this->requestIsValid = (bool) $isValid;
+       public final function setIsRequestValid (bool $isValid) {
+               $this->isRequestValid = $isValid;
        }
 
        /**
         * Returns whether this request is valid
         *
-        * @return      $requestIsValid         Whether this request is valid
+        * @return      $isRequestValid         Whether this request is valid
         */
        public final function isRequestValid () {
-               return $this->requestIsValid;
+               return $this->isRequestValid;
        }
 
 }