• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
getStatusCode Deprecation

In CodeIgniter\HTTP\ResponseInterface the getStatusCode function is deprecated and says, "To be replaced by the PSR-7 version (compatible)". I am curious as to why this was deprecated since it is part of the ResponseInterface in the PSR 7 spec found at https://www.php-fig.org/psr/psr-7/. If this should be deprecated, what should we be using as an alternative function to get the status code?

The problem is that the framework’s signature includes the return type (“: int”) which makes it incompatible with the PSR interface. The method will remain and will continue to work but we needed developers to realize that the method signature will change.
That said FIG has been releasing updated interfaces for PHP 8 with complete method signatures, and since these deprecations would not go into full effect until CodeIgniter 5 I don’t know what that means for the future of our HTTP layer.

OK, thanks for letting me know. I won't worry about replacing it then.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.