Welcome Guest, Not a member yet? Register   Sign In
source code says Request::getMethod() is deprecated, what to use?

Anyway to hide/suppress deprecated warnings you may do this

error_reporting(E_ALL ^ E_DEPRECATED);
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )

(This post was last modified: 03-29-2023, 09:30 AM by alphastudiofr.)

+1 on not using @deprecated in the docblock when the function as a whole is not deprecated.

phpDocument defines the tag as meaning the element associated with the docblock is deprecated (in this case the method as a whole, not just one of its functionalities):

IDEs implement the same logic, leading to the method showing as strike through in the code and other various warnings.

For instance in PhpStorm, hovering the method, you do get the detailed comment on the $upper functionality if you read through, but the main message is "Method 'getMethod' is deprecated".

[Image: getmethod.png]

Triggering the wrong warning is never a good strategy. Deprecated warnings are useful when they can lead to a fix. In this case, there is no fix, so you're left with a permanent warning, and the idea that CodeIgniter's code triggers false alarms that you just have to ignore... Never a good thing if awareness is what you want to achieve.

@alphastudiofr Thank you for your opinion.
We don't think the current way is the best.
If you have a better way to inform CI4 users that, please send a PR.

I recommend to use the new is() method.

Theme © iAndrew 2016 - Forum software by © MyBB