-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make framework PHP 7.4 compatible #16
Conversation
There were a bunch a minor changes needed like trimming slashes and octothorpes of strings before passing them into hexdec and removing all array accesses via curly braces. I have no idea how Zend_Crypt_Math::rand ever worked under unixlikes because we expect it to return a number but it outputs directly from /dev/urandom if it exists. Serialization of ReflectionMethods is also illegal since 7.4 A lot of docblocks were updated, assertions changed to more obvious ones and grimey things like dirname(__FILE__) were properly removed whenever I encountered them for most files that I touched.
@Megatherium could you modify the travis config and replace |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your work on this! Did you use a tool or did you do all the changes manually?
Just one test to fix (a different expected error message for php 7.4+) and we should probably get rid of that broken /dev/urandom implementation.
The method returned random bytes if /dev/urandom exists even though a random integer was expected.
I basically just used PHPStorm with some plugins and spammed a lot of Alt+Enter for the docblocks. Most of the changes to the code (that weren't necessitated by failing tests) were also suggested by the IDE but I was rather conservative in what I actually changed especially when it came to changing == to ===. |
Generalized the expected exception text so we don't need any version compares. Holler if you need anything else done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you once again!
Released version 1.13.1 of all packages. |
@@ -104,11 +104,11 @@ public function __construct($service, $data) | |||
// require_once 'Zend/Service/Rackspace/Servers/Exception.php'; | |||
throw new Zend_Service_Rackspace_Servers_Exception(self::ERROR_PARAM_CONSTRUCT); | |||
} | |||
if (!array_key_exists('name', $data)) { | |||
if (!isset($data['name'])) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that array_key_exists
will return true
if an array entry is NULL
while isset
will return false
.
So this is a functional change....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right @holtkamp ... @Megatherium could you elaborate on this change, please? Did it even make sense to allow NULL
values in id
and name
before? But I tend to agree this should not go like that into a patch release...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have to admit that I was overeager and ignorant of the minute difference.
There were a bunch a minor changes needed like trimming slashes and
octothorpes of strings before passing them into hexdec and removing all
array accesses via curly braces.
I have no idea how Zend_Crypt_Math::rand ever worked under unixlikes
because we expect it to return a number but it outputs directly from
/dev/urandom if it exists.
Serialization of ReflectionMethods is also illegal since 7.4
A lot of docblocks were updated, assertions changed to more obvious ones
and grimey things like dirname(FILE) were properly removed whenever
I encountered them for most files that I touched.