]> git.mxchange.org Git - core.git/blobdiff - framework/main/interfaces/request/class_Requestable.php
Continued:
[core.git] / framework / main / interfaces / request / class_Requestable.php
index 24b295a941fee9280cd60b70e8224bb44e644dd8..55f4cac4cc10435a78808ee826cfd4cec9c17d3a 100644 (file)
@@ -1,16 +1,16 @@
 <?php
 // Own namespace
-namespace CoreFramework\Request;
+namespace Org\Mxchange\CoreFramework\Request;
 
 // Import framework stuff
-use CoreFramework\Generic\FrameworkInterface;
+use Org\Mxchange\CoreFramework\Generic\FrameworkInterface;
 
 /**
  * An interface for requests
  *
  * @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 - 2020 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -28,21 +28,13 @@ use CoreFramework\Generic\FrameworkInterface;
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
 interface Requestable extends FrameworkInterface {
-       /**
-        * Prepares the request data for usage
-        *
-        * @return      void
-        */
-       function prepareRequestData ();
-
        /**
         * Checks whether a request element is set
         *
         * @param       $element        Name of the request element we want to check
         * @return      $isSet          Whether the request element is set
-        * @throws      MissingArrayElementsException   Thrown if a request element is not set
         */
-       function isRequestElementSet ($element);
+       function isRequestElementSet (string $element);
 
        /**
         * Getter for request element or 'null' if element was not found
@@ -51,58 +43,45 @@ interface Requestable extends FrameworkInterface {
         * @return      $value          Value of the found request element or 'null' if the
         *                                              element was not found
         */
-       function getRequestElement ($element);
-
-       /**
-        * Wrapper method for array_key() function for the request data array
-        *
-        * @return      $array  An array containing all array keys to return
-        */
-       function getParameterNames ();
+       function getRequestElement (string $element);
 
        /**
-        * Getter for a header element or 'null' if header was not found
+        * Setter for request elements
         *
-        * @param       $headerName             Name of the header
-        * @return      $headerValue    Value of the header or 'null' if not found
-        */
-       function getHeaderElement ($headerName);
-
-       /**
-        * Sets whether the request was valid (default: TRUE)
-        *
-        * @param       $isValid        Whether the request is valid
+        * @param       $element        Request element to se
+        * @param       $value          Value to set
         * @return      void
         */
-       function requestIsValid ($isValid = TRUE);
+       function setRequestElement (string $element, $value);
 
        /**
-        * Reads a cookie and returns it's value or null if not found
+        * Setter for request data array
         *
-        * @param       $cookieName             Name of cookie we shall read
-        * @return      $cookieValue    Value of cookie or null if not found
+        * @param       $requestData    Request element to se
+        * @return      void
         */
-       function readCookie ($cookieName);
+       function setRequestData (array $requestData);
 
        /**
-        * Checks if the request method is GET.
+        * Wrapper method for array_key() function for the request data array
         *
-        * @return      $isGet  Whether the request method is GET
+        * @return      $array  An array containing all array keys to return
         */
-       function isGetRequestMethod ();
+       function getParameterNames ();
 
        /**
-        * Checks if the request method is HEAD.
+        * Sets whether the request was valid (default: true)
         *
-        * @return      $isHead         Whether the request method is HEAD
+        * @param       $isValid        Whether the request is valid
+        * @return      void
         */
-       function isHeadRequestMethod ();
+       function requestIsValid (bool $isValid = true);
 
        /**
-        * Checks if the request method is POST.
+        * Returns whether this request is valid
         *
-        * @return      $isPost         Whether the request method is POST
+        * @return      $requestIsValid         Whether this request is valid
         */
-       function isPostRequestMethod ();
+       function isRequestValid ();
 
 }