CodeIgniter Forums
Erroneous Deprecated Annotation - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30)
+--- Thread: Erroneous Deprecated Annotation (/showthread.php?tid=87530)



Erroneous Deprecated Annotation - donpwinston - 04-30-2023

There is an erroneous "@deprecated" annotation in system/HTTP/Request.php. I've posted this before and the person who looked at it didn't want to accept the fact that is wrong. The deprecated annotation signals that the entire method is deprecated. This is not true. It should be removed. I know it is trivial but it messes up my DevSense extension in VSCode which flags the getMethod() function as deprecated. It is annoying. The engineer at DevSense says the proper way to deprecate a parameter of a function is use "#[Deprecated]" above the "@param bool $upper" annotation. Don't ask me to do a pull request. I do not write code unless I'm paid. If anyone else would like the experience of performing a pull request and hasn't done very many of them before, or none at all then you are welcome to do it for me.

PHP Code:
/**
    * Get the request method.
    *
    * @param bool $upper Whether to return in upper or lower case.
    *
    * @deprecated The $upper functionality will be removed and this will revert to its PSR-7 equivalent
    *
    * @codeCoverageIgnore
    */
    public function getMethod(bool $upper false): string
    
{
        return ($upper) ? strtoupper($this->method) : strtolower($this->method);
    



RE: Erroneous Deprecated Annotation - iRedds - 04-30-2023

I think that if you pay for PR, then maybe someone will want to solve your problem.


RE: Erroneous Deprecated Annotation - donpwinston - 05-01-2023

(04-30-2023, 09:17 PM)iRedds Wrote: I think that if you pay for PR, then maybe someone will want to solve your problem.

I'd think the developers working on CI would want to fix it no matter their motivation.