Browse Source

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

Xavier Perez 14 năm trước cách đây
mục cha
commit
0d56ca5654
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  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));
         }