فهرست منبع

[HttpFoundation] added a keys() method to *Bag classes

Fabien Potencier 14 سال پیش
والد
کامیت
086708003a
2فایلهای تغییر یافته به همراه20 افزوده شده و 0 حذف شده
  1. 10 0
      src/Symfony/Component/HttpFoundation/HeaderBag.php
  2. 10 0
      src/Symfony/Component/HttpFoundation/ParameterBag.php

+ 10 - 0
src/Symfony/Component/HttpFoundation/HeaderBag.php

@@ -48,6 +48,16 @@ class HeaderBag
         return $this->headers;
         return $this->headers;
     }
     }
 
 
+    /**
+     * Returns the parameter keys.
+     *
+     * @return array An array of parameter keys
+     */
+    public function keys()
+    {
+        return array_keys($this->headers);
+    }
+
     /**
     /**
      * Replaces the current HTTP headers by a new set.
      * Replaces the current HTTP headers by a new set.
      *
      *

+ 10 - 0
src/Symfony/Component/HttpFoundation/ParameterBag.php

@@ -40,6 +40,16 @@ class ParameterBag
         return $this->parameters;
         return $this->parameters;
     }
     }
 
 
+    /**
+     * Returns the parameter keys.
+     *
+     * @return array An array of parameter keys
+     */
+    public function keys()
+    {
+        return array_keys($this->parameters);
+    }
+
     /**
     /**
      * Replaces the current parameters by a new set.
      * Replaces the current parameters by a new set.
      *
      *