]> git.mxchange.org Git - core.git/blobdiff - framework/main/classes/request/console/class_ConsoleRequest.php
Continued:
[core.git] / framework / main / classes / request / console / class_ConsoleRequest.php
index 3a85f3e2b495698177d8bbbc8badfafc5853c3ea..c8b91d7bab9b1765d655c0d54c839d8ad74cf3c4 100644 (file)
@@ -11,11 +11,7 @@ use Org\Mxchange\CoreFramework\Request\Requestable;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
-<<<<<<< HEAD:framework/main/classes/request/console/class_ConsoleRequest.php
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2017 Core Developer Team
-=======
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2016 Core Developer Team
->>>>>>> Some updates::inc/main/classes/request/console/class_ConsoleRequest.php
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2021 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -38,7 +34,7 @@ class ConsoleRequest extends BaseRequest implements Requestable {
         *
         * @return      void
         */
-       protected function __construct () {
+       private function __construct () {
                // Call parent constructor
                parent::__construct(__CLASS__);
        }
@@ -69,7 +65,7 @@ class ConsoleRequest extends BaseRequest implements Requestable {
                if ((!isset($_SERVER['argv'])) || (!isset($_SERVER['argc']))) {
                        // Maybe not right PHP mode? (needs CLI?)
                        trigger_error(sprintf('[%s:%d]: argv/argc not set: %s', __METHOD__, __LINE__, print_r($_SERVER, true)), E_USER_ERROR);
-               } // END - if
+               }
 
                // Get the "request data" from the command-line argument list
                $args = $_SERVER['argv'];
@@ -78,13 +74,13 @@ class ConsoleRequest extends BaseRequest implements Requestable {
                if ($_SERVER['argc'] < 2) {
                        // Skip this
                        return;
-               } // END - if
+               }
 
                // Is the first element "index.php" ?
                if ($args[0] == 'index.php') {
                        // Then remove it
                        array_shift($args);
-               } // END - if
+               }
 
                // Try to determine next parameters
                foreach ($args as $arg) {
@@ -99,7 +95,7 @@ class ConsoleRequest extends BaseRequest implements Requestable {
                                // Set a name=value pair escaped and secured
                                $this->setRequestElement($argArray[0], escapeshellcmd($argArray[1]));
                        }
-               } // END - foreach
+               }
        }
 
        /**
@@ -109,7 +105,7 @@ class ConsoleRequest extends BaseRequest implements Requestable {
         * @return      $headerValue    Value of the header or 'null' if not found
         * @throws      UnsupportedOperationException   This method should never be called
         */
-       public function getHeaderElement ($headerName) {
+       public function getHeaderElement (string $headerName) {
                // Console doesn't have any headers
                throw new UnsupportedOperationException(array($this, __FUNCTION__, $executorInstance), self::EXCEPTION_UNSPPORTED_OPERATION);
        }
@@ -131,7 +127,7 @@ class ConsoleRequest extends BaseRequest implements Requestable {
         * @return      $cookieValue    Value of cookie or null if not found
         * @throws      UnsupportedOperationException   This method should never be called
         */
-       public final function readCookie ($cookieName) {
+       public final function readCookie (string $cookieName) {
                // There are no cookies on console
                throw new UnsupportedOperationException(array($this, __FUNCTION__, $executorInstance), self::EXCEPTION_UNSPPORTED_OPERATION);
        }