(bug 37183) Removed hard coded parentheses in SpecialListfiles.php
[lhc/web/wiklou.git] / includes / Cookie.php
index 95a4599..1ca02b5 100644 (file)
@@ -1,6 +1,24 @@
 <?php
 /**
- * @defgroup HTTP HTTP
+ * Cookie for HTTP requests.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ * @ingroup HTTP
  */
 
 class Cookie {
@@ -139,6 +157,10 @@ class Cookie {
                return $ret;
        }
 
+       /**
+        * @param $domain
+        * @return bool
+        */
        protected function canServeDomain( $domain ) {
                if ( $domain == $this->domain
                        || ( strlen( $domain ) > strlen( $this->domain )
@@ -151,20 +173,19 @@ class Cookie {
                return false;
        }
 
+       /**
+        * @param $path
+        * @return bool
+        */
        protected function canServePath( $path ) {
-               if ( $this->path && substr_compare( $this->path, $path, 0, strlen( $this->path ) ) == 0 ) {
-                       return true;
-               }
-
-               return false;
+               return ( $this->path && substr_compare( $this->path, $path, 0, strlen( $this->path ) ) == 0 );
        }
 
+       /**
+        * @return bool
+        */
        protected function isUnExpired() {
-               if ( $this->isSessionKey || $this->expires > time() ) {
-                       return true;
-               }
-
-               return false;
+               return $this->isSessionKey || $this->expires > time();
        }
 }
 
@@ -190,6 +211,7 @@ class CookieJar {
 
        /**
         * @see Cookie::serializeToHttpRequest
+        * @return string
         */
        public function serializeToHttpRequest( $path, $domain ) {
                $cookies = array();
@@ -210,6 +232,7 @@ class CookieJar {
         *
         * @param $cookie String
         * @param $domain String: cookie's domain
+        * @return null
         */
        public function parseCookieResponseHeader ( $cookie, $domain ) {
                $len = strlen( 'Set-Cookie:' );