-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Prep for PHP 8 #3931
Prep for PHP 8 #3931
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -416,6 +416,11 @@ protected function handleRequest(RouteCollectionInterface $routes = null, Cache | |
{ | ||
$controller = $this->createController(); | ||
|
||
if (! method_exists($controller, '_remap') && ! is_callable([$controller, $this->method], false)) | ||
{ | ||
throw PageNotFoundException::forMethodNotFound($this->method); | ||
} | ||
|
||
// Is there a "post_controller_constructor" event? | ||
Events::trigger('post_controller_constructor'); | ||
|
||
|
@@ -890,11 +895,6 @@ protected function startController() | |
{ | ||
throw PageNotFoundException::forControllerNotFound($this->controller, $this->method); | ||
} | ||
if (! method_exists($this->controller, '_remap') && | ||
! is_callable([$this->controller, $this->method], false)) | ||
Comment on lines
-893
to
-894
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. PHP 8 changes the behavior of
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Related to testing, I think we should change how we invoked phpunit's There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We're doing it "the PHPUnit way": https://phpunit.readthedocs.io/en/9.3/assertions.html I didn't even realize they were static. Is there some localized forwarder or something? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've looked into the code of TestCase and Assert and didn't find some wrapper to dynamic calls. Maybe phpunit is taking advantage of the way static methods can be called dynamically in php lt 8. |
||
{ | ||
throw PageNotFoundException::forMethodNotFound($this->method); | ||
} | ||
} | ||
|
||
//-------------------------------------------------------------------- | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -134,7 +134,7 @@ public function connect(bool $persistent = false) | |
if ($this->encrypt['ssl_verify']) | ||
{ | ||
defined('MYSQLI_OPT_SSL_VERIFY_SERVER_CERT') && | ||
$this->mysqli->options(MYSQLI_OPT_SSL_VERIFY_SERVER_CERT, true); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Another subset of changes are for using booleans for |
||
$this->mysqli->options(MYSQLI_OPT_SSL_VERIFY_SERVER_CERT, 1); | ||
} | ||
// Apparently (when it exists), setting MYSQLI_OPT_SSL_VERIFY_SERVER_CERT | ||
// to FALSE didn't do anything, so PHP 5.6.16 introduced yet another | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -97,6 +97,6 @@ public static function setPrivateProperty($obj, $property, $value) | |
public static function getPrivateProperty($obj, $property) | ||
{ | ||
$refProperty = self::getAccessibleRefProperty($obj, $property); | ||
return $refProperty->getValue($obj); | ||
return is_string($obj) ? $refProperty->getValue() : $refProperty->getValue($obj); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure how this was working previously, but in PHP 8 |
||
} | ||
} |
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.
PHP 8 uses
GDImage
class type for theimage*
functions, which works fine with our current code but breaks the analysis. Ignoring the only file with these references until it can be reworked to support all versions or until PHPStan adds version-specific exemption handling.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.
Maybe we can use stub files for this? I'm not sure if there is a capability in phpstan to conditionally include stub files based on the current PHP version.