Skip to content
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

Merged
merged 1 commit into from Mar 24, 2017
Merged

Prepare for PHP7.2 #708

merged 1 commit into from Mar 24, 2017

Conversation

hboomsma
Copy link

  • 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

Copy link
Member

@theofidry theofidry left a 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(
Copy link
Member

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.

Copy link
Author

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) {

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

useless blank line

Copy link
Author

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)) {
Copy link
Member

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 :)

Copy link
Author

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
@theofidry theofidry merged commit 0976436 into nelmio:2.x Mar 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants