-
-
Notifications
You must be signed in to change notification settings - Fork 332
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
Prepare for PHP7.2 #708
Prepare for PHP7.2 #708
Conversation
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.
Cool! Minor comments left :)
@@ -45,6 +45,12 @@ public function getValue() | |||
public function valueMatches($regex) | |||
{ | |||
if (preg_match($regex, $this->value, $matches)) { | |||
$matches = array_map( |
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.
if the preg_match change is deprecated I would not change that yet, it wouldn't be the first time such things are reverted and I didn't see much discussion in php/php-src#1303.
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'll remove this, it will result in a failing nightly branch for now. When PHP decides to be BC again the branch should turn green (on a rebuild)
if (!is_array($args)) { | ||
throw new \UnexpectedValueException("The static '{$method}' call in object '{$this}' must be given an array"); | ||
foreach ($constructorValue as $method => $args) { | ||
|
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.
useless blank line
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.
👍
"Cannot call static method '{$method}' on class '{$this->class}' as a constructor for object '{$this}'" | ||
); | ||
} | ||
if (!is_array($args)) { |
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.
while we are at it let's add a blank line here between the two if :)
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.
👍
* Run composer with --ignore-platform-reqs for nightly * Run composer with weak deprecation warnings (PHPUnint still uses each()) * Rewrote usage of each() (which is deprecated in PHP7.2) * `preg_match` returns `NULL` instead of `''` since PHP7.2
preg_match
returnsNULL
instead of''
since PHP7.2