X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=framework%2Fmain%2Fclasses%2Frequest%2Fclass_BaseRequest.php;h=d52d9914823a661d27f9816a802a495116032d91;hb=4d92fa6063058d861ffd7b82d0fb8dd58ffc1d27;hp=eaff2be05e1d65a5ca1b98eb970cb323c8052c4a;hpb=146c8b3c929a1b0ab17d6605e5ae949ac44899c1;p=core.git diff --git a/framework/main/classes/request/class_BaseRequest.php b/framework/main/classes/request/class_BaseRequest.php index eaff2be0..d52d9914 100644 --- a/framework/main/classes/request/class_BaseRequest.php +++ b/framework/main/classes/request/class_BaseRequest.php @@ -1,16 +1,16 @@ * @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; } }