Now two methods should never be called, the UnsupportedOperationException will
authorRoland Häder <roland@mxchange.org>
Tue, 17 May 2011 21:37:08 +0000 (21:37 +0000)
committerRoland Häder <roland@mxchange.org>
Tue, 17 May 2011 21:37:08 +0000 (21:37 +0000)
be thrown if you still do so.

inc/classes/main/request/console/class_ConsoleRequest.php

index e1b2bd31fd34d458d114141b51dc5cf0dc326f95..1402332e0bfad1d7e989a8e661a9dc02508da148 100644 (file)
@@ -52,7 +52,6 @@ class ConsoleRequest extends BaseRequest implements Requestable {
         * Prepares the request data for usage
         *
         * @return      void
-        * @todo        Needs to be implemented
         */
        public function prepareRequestData () {
                // Get the "request data" from the command-line argument list
@@ -91,9 +90,11 @@ class ConsoleRequest extends BaseRequest implements Requestable {
         *
         * @param       $headerName             Name of the header
         * @return      $headerValue    Value of the header or 'null' if not found
+        * @throws      UnsupportedOperationException   This method should never be called
         */
        public function getHeader ($headerName) {
-               $this->partialStub('Please implement this method.');
+               // Console doesn't have any headers
+               throw new UnsupportedOperationException(array($this, __FUNCTION__, $executorInstance), self::EXCEPTION_UNSPPORTED_OPERATION);
        }
 
        /**
@@ -102,6 +103,7 @@ class ConsoleRequest extends BaseRequest implements Requestable {
         * @return      $requestMethod  Used request method
         */
        public final function getRequestMethod () {
+               // @TODO Can't this be 'CONSOLE' ?
                return 'LOCAL';
        }
 
@@ -110,10 +112,11 @@ class ConsoleRequest extends BaseRequest implements Requestable {
         *
         * @param       $cookieName             Name of cookie we shall read
         * @return      $cookieValue    Value of cookie or null if not found
+        * @throws      UnsupportedOperationException   This method should never be called
         */
        public final function readCookie ($cookieName) {
-               // @TODO There are no cookies on console
-               return null;
+               // There are no cookies on console
+               throw new UnsupportedOperationException(array($this, __FUNCTION__, $executorInstance), self::EXCEPTION_UNSPPORTED_OPERATION);
        }
 }