Explorar el Código

[HttpFoundation] Replace a duplicated test with a method in Response

Xavier Perez hace 14 años
padre
commit
0d56ca5654
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      src/Symfony/Component/HttpFoundation/Response.php

+ 1 - 1
src/Symfony/Component/HttpFoundation/Response.php

@@ -217,7 +217,7 @@ class Response
     public function setStatusCode($code, $text = null)
     {
         $this->statusCode = (int) $code;
-        if ($this->statusCode < 100 || $this->statusCode > 599) {
+        if ($this->isInvalid()) {
             throw new \InvalidArgumentException(sprintf('The HTTP status code "%s" is not valid.', $code));
         }