diff --git a/phpstan.neon.dist b/phpstan.neon.dist index a90567227621..1de9abeb3e2d 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -24,6 +24,7 @@ parameters: - system/Commands/Generators/Views/* - system/Config/Routes.php - system/Debug/Toolbar/Views/toolbar.tpl.php + - system/Images/Handlers/GDHandler.php - system/ThirdParty/* - system/Validation/Views/single.php ignoreErrors: diff --git a/system/CodeIgniter.php b/system/CodeIgniter.php index 5267d853c97c..1e90cdc7541f 100644 --- a/system/CodeIgniter.php +++ b/system/CodeIgniter.php @@ -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)) - { - throw PageNotFoundException::forMethodNotFound($this->method); - } } //-------------------------------------------------------------------- diff --git a/system/Database/MySQLi/Connection.php b/system/Database/MySQLi/Connection.php index e5309e5aa0f1..5916db832c95 100644 --- a/system/Database/MySQLi/Connection.php +++ b/system/Database/MySQLi/Connection.php @@ -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); + $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 diff --git a/system/Log/Handlers/ChromeLoggerHandler.php b/system/Log/Handlers/ChromeLoggerHandler.php index 2c052d743a45..b248072aa829 100644 --- a/system/Log/Handlers/ChromeLoggerHandler.php +++ b/system/Log/Handlers/ChromeLoggerHandler.php @@ -111,7 +111,7 @@ public function handle($level, $message): bool $message = $this->format($message); // Generate Backtrace info - $backtrace = debug_backtrace(false, $this->backtraceLevel); + $backtrace = debug_backtrace(0, $this->backtraceLevel); $backtrace = end($backtrace); $backtraceMessage = 'unknown'; diff --git a/system/Test/ReflectionHelper.php b/system/Test/ReflectionHelper.php index 81cbb83194a3..9934b03f4978 100644 --- a/system/Test/ReflectionHelper.php +++ b/system/Test/ReflectionHelper.php @@ -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); } } diff --git a/tests/system/Cache/Handlers/FileHandlerTest.php b/tests/system/Cache/Handlers/FileHandlerTest.php index 6a1054926433..bb77935abf10 100644 --- a/tests/system/Cache/Handlers/FileHandlerTest.php +++ b/tests/system/Cache/Handlers/FileHandlerTest.php @@ -1,10 +1,6 @@ config); $request->uri = new URI('http://example.com/'); @@ -912,7 +912,7 @@ public function safeMailtoPatterns() /** * @dataProvider safeMailtoPatterns */ - public function testSafeMailto($expected = '', $email, $title = '', $attributes = '') + public function testSafeMailto($expected = '', $email = '', $title = '', $attributes = '') { $request = Services::request($this->config); $request->uri = new URI('http://example.com/');