New in Symfony 2.4: Using Constants for HTTP Status Code
Instead of relying on HTTP status code as integer in your code, which might look like magic values to some, it might be more readable to use the new constants provided by the Symfony Response class in 2.4:
1 2 3
use Symfony\Component\HttpFoundation\Response; $this->assertEquals(Response::HTTP_OK, $response->getStatusCode());
See the Response class for a full list of supported constants.
New in Symfony 2.4: Using Constants for HTTP Status Code symfony.com/index.php/blog/new-in-symfony-2-4-using-constants-for-http-status-codeTweet this
Become a certified developer! Exams are online and available in all countries.Register Now
Comments are closed.
To ensure that comments stay relevant, they are closed for old posts.