瀏覽代碼

Renamed variable returned and used self in place of static for constants

Francis Besset 14 年之前
父節點
當前提交
7cf891a448
共有 1 個文件被更改,包括 7 次插入7 次删除
  1. 7 7
      src/Symfony/Component/HttpFoundation/ResponseHeaderBag.php

+ 7 - 7
src/Symfony/Component/HttpFoundation/ResponseHeaderBag.php

@@ -147,26 +147,26 @@ class ResponseHeaderBag extends HeaderBag
      *
      * @return array
      */
-    public function getCookies($format = 'flat')
+    public function getCookies($format = self::COOKIES_FLAT)
     {
-        if (!in_array($format, array(static::COOKIES_FLAT, static::COOKIES_ARRAY))) {
-            throw new \InvalidArgumentException(sprintf('Format "%s" invalid (%s).', $format, implode(', ', array(static::COOKIES_FLAT, static::COOKIES_ARRAY))));
+        if (!in_array($format, array(self::COOKIES_FLAT, self::COOKIES_ARRAY))) {
+            throw new \InvalidArgumentException(sprintf('Format "%s" invalid (%s).', $format, implode(', ', array(self::COOKIES_FLAT, self::COOKIES_ARRAY))));
         }
 
-        if (static::COOKIES_ARRAY === $format) {
+        if (self::COOKIES_ARRAY === $format) {
             return $this->cookies;
         }
 
-        $return = array();
+        $flattenedCookies = array();
         foreach ($this->cookies as $path) {
             foreach ($path as $cookies) {
                 foreach ($cookies as $cookie) {
-                    $return[] = $cookie;
+                    $flattenedCookies[] = $cookie;
                 }
             }
         }
 
-        return $return;
+        return $flattenedCookies;
     }
 
     /**