Explorar el Código

[HttpFoundation] cleaned up some constructors

Kris Wallsmith hace 14 años
padre
commit
c67a9a9643

+ 0 - 4
src/Symfony/Component/HttpFoundation/FileBag.php

@@ -30,10 +30,6 @@ class FileBag extends ParameterBag
      */
     public function __construct(array $parameters = array())
     {
-        // this line is not necessary, but including it avoids any stupid
-        // errors if we add code to the parent's constructor
-        parent::__construct();
-
         $this->replace($parameters);
     }
 

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

@@ -27,11 +27,11 @@ class ResponseHeaderBag extends HeaderBag
      */
     public function __construct(array $headers = array())
     {
-        // this line is not necessary, but including it avoids any stupid
-        // errors if we add code to the parent's constructor
-        parent::__construct();
+        parent::__construct($headers);
 
-        $this->replace($headers);
+        if (!isset($this->headers['cache-control'])) {
+            $this->set('cache-control', '');
+        }
     }
 
     /**