Ver código fonte

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

Xavier Perez 14 anos atrás
pai
commit
0d56ca5654
1 arquivos alterados com 1 adições e 1 exclusões
  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));
         }