contexts icon indicating copy to clipboard operation
contexts copied to clipboard

Prefer reflection method getType as getClass deprected as of PHP 8.0

Open webdevel opened this issue 3 years ago • 2 comments

Please consider releasing this quick patch supporting PHP upgrade. Thank you.

ReflectionParameter::getClass

Warning This function has been DEPRECATED as of PHP 8.0.0. Relying on this function is highly discouraged.

https://www.php.net/manual/en/reflectionparameter.getclass.php https://www.php.net/manual/en/reflectionparameter.gettype.php

webdevel avatar Mar 03 '21 22:03 webdevel

Thanks for this, unfortunately your fork still results in my tests failing. I may try a PR as well to resolve this.

silverbackdan avatar Mar 11 '21 18:03 silverbackdan

Just created a new PR @webdevel - hopefully it would also work for you, but I imagine this fix already did the job for you. At least in my tests it has stopped the getClass method from ever being called if getType is available and has extracted this logic into a new method. https://github.com/Behatch/contexts/pull/298

silverbackdan avatar Mar 11 '21 19:03 silverbackdan