• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
source code says Request::getMethod() is deprecated, what to use?

#1
The source code says Request::getMethod() is deprecated. What should we use instead?
PHP Code:
    /**
     * Get the request method.
     *
     * @param boolean $upper Whether to return in upper or lower case.
     *
     * @return string
     *
     * @deprecated The $upper functionality will be removed and this will revert to its PSR-7 equivalent
     */
    
public function getMethod(bool $upper false): string
    
{
        return (
$upper) ? strtoupper($this->method) : strtolower($this->method);
    } 
Reply

#2
The method is not deprecated, the optional [$upper] parameter is deprecated. In the future the request method name will only be returned in lower case. You may review the documentation here: https://codeigniter.com/user_guide/incom...#getMethod.
Reply

#3
(02-25-2021, 06:01 PM)mlurie Wrote: The method is not deprecated, the optional [$upper] parameter is deprecated. 
Perhaps someone needs to change the comments and remove that @deprecated bit then. In my IDE, this results in the method being displayed in strikethrough text:
Quote:@deprecated The $upper functionality will be removed and this will revert to its PSR-7 equivalent
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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