-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Fixes: a few issues found when running PHP 7.3 #12487
Conversation
lib/Cake/Network/CakeResponse.php
Outdated
} | ||
if ($modifiedSince) { | ||
$timeMatches = strtotime($this->modified()) === strtotime($modifiedSince); | ||
} else { | ||
$timeMatches = false; |
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 could hoist these to line 1164 and do $etagMatches = $timeMatches = false
.
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.
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.
But if (empty($checks))
is now never empty
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.
@garas How about we wrap in array_filter
? if (empty(array_filter($checks)))
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.
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.
Tests fails (in 3.6 branch).
Maybe
$checks = array();
if ($responseTag) {
$checks[] = ...;
}
if ($modifiedSince...) {
$checks[] = ...;
}
// no compact()
There is difference [ ]
vs [false, false]
here.
Port these changes to 3.6
too.
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.
Modified. I'll try to get to 3.6 later
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.
Tests fail
@@ -95,6 +95,7 @@ public function trigger($callback, $params = array(), $options = array()) { | |||
if (empty($this->_enabled)) { | |||
return true; | |||
} | |||
$subject = null; |
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.
Tests fail here too.
Very similar problem.
To CakePHP Team: Why Travis tests are not running on 2.x
?
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.
To CakePHP Team: Why Travis tests are not running on 2.x?
I'm not sure. Travis used to run tests for 2.x Its possible that there is a problem with the configuration file, or perhaps we're trying to use an unsupported worker type.
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.
It looks like travis ran tests for 2.x 8 days ago I'm not sure why it isn't running this pull request.
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.
Can we merge this as this seems to be a Travis issue?
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.
Tests fail here, so should be fixed
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.
lib/Cake/Console/cake test core AllTests
You can also run only some test cases like Utility/ObjectCollection
or Network/CakeResponse
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 cannot install PHPUnit 3.7, as I already have 7.3 installed on my machine. Can you help me here, by showing me the issue? Could not find it in the PR tools
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 can install phpunit in CakePHP dir with composer require --dev phpunit/phpunit:"3.7.38"
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.
Pushed a fix, and now both tests are passing
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.
Can this get merged?
@@ -95,6 +95,7 @@ public function trigger($callback, $params = array(), $options = array()) { | |||
if (empty($this->_enabled)) { | |||
return true; | |||
} | |||
$subject = null; |
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.
Tests fail here, so should be fixed
@josephzidell I will get this merged when I get a chance to run tests locally, as travis is not cooperating. |
Thanks @markstory |
Thanks
…On Sun, Sep 9, 2018, 12:50 PM Mark Story ***@***.***> wrote:
Merged #12487 <#12487> into 2.x.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#12487 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABun24Wqc9DwF9P7rYj4PCMTm_GPU4Ibks5uZUbfgaJpZM4WGZXD>
.
|
I tried running 2.x on PHP 7.3, and fixed a few simple issues, such as:
preg_match()