[4.0] Adding version switch in Image and Imagefilter for PHP8#28694
[4.0] Adding version switch in Image and Imagefilter for PHP8#28694HLeithner merged 6 commits intojoomla:4.0-devfrom
Conversation
|
@Hackwar Just a question from reading: Ist it correct that the first check if Or should it apply in both of the cases separated by the As I said, just a question from reading, maybe all is fine as is it. |
|
No, that is fine the way it is. $source can be null and get_class(null) (or anything not an object) will throw an error. Anyhow, with this PR and the bunch of changes we did to drone and the docker images used, I can now happily proclaim that we are passing all tests. |
|
hmm can you think of any reason that RIPS would complain about files in this path: |
|
@zero-24 seems to be a RIPS glitch. Whitelisted the issues and restarted the build |
|
We should be consistent on how we handle this. I think its enough if we check for object and resource (including type) and not for the php version. Also please add a comment that resource can be removed if we only support php 8+ |
| $this->handle = &$source; | ||
| $this->handle = $source; |
There was a problem hiding this comment.
I'm not sure if this by-reference has any effect. In the end we are only handing over a pointer here, right? So it shouldn't matter if we hand this over by reference or not. Can anybody confirm me on that?
|
I added the comments and unified the handling. Please review again and give thumbs up/down. |
|
Thanks |
…#28694) * Adding version switch in Image and Imagefilter for PHP8 * Simplifying the logic * Removing logic inversion * Unifying handling of feature check
As we are now using php8 the TODO has been resolved and the code can be removed See comment joomla#28694 (comment)
PHP8 changed the behavior of GD to use objects instead of resources. As we are now using php8 the TODO has been resolved and the code can be removed See comment #28694 (comment)
Resolve todo as we only support php8 now. This should probably have been done when I did joomla#41855 Original PR where this check was added joomla#28694 Signed-off-by: BrianTeeman <brian@teeman.net>
Resolve todo as we only support php8 now. This should probably have been done when I did joomla#41855 Original PR where this check was added joomla#28694 Signed-off-by: BrianTeeman <brian@teeman.net>
PHP8 changed the behavior of GD to use objects instead of resources. This introduces version dependent handling in the code and thus should make this work again. Since we have good unittests for this, this should be enough to test this.