You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I appreciate the reluctance not to use strict_types and if this small change is not allowed I would be grateful to know why the defined type parameter does not match the expected predefined function type parameter.
Numerous functions in the system folder have function parameter types specified and because declare(strict_types=1); is not set then the parameter types are type juggled. No errors are reported even though error_reporting is set to the maximum value of -1.
Changing these three files:
/app/config/Boot/development.php
/app/config/Boot/production.php
/app/config/Boot/testing.php // not tested :)
and defining CI_DEBUG to use boolean parameters instead of integers matches the parameters of "system/Log/Logger.php:155"
The following error log was generated when "system/Log/Logger.php" was declared(strict_types=1);
Uncaught TypeError:
Argument 2 passed to CodeIgniter\Log\Logger::__construct()
must be of the type boolean, integer given,
called in /var/www/ci2/ci4-strict-github/system/Config/Services.php on line 432
and
defined in /var/www/ci2/ci4-strict-github/system/Log/Logger.php:155 Stack trace:
CodeIgniter 4 version
Ver: 4.0.0-rc.2.1
Affected module(s)
system/Log/Logger.php
Expected behavior, and steps to reproduce if appropriate
I did not expect errors to be generated when declare(strict_types=1); was set/
Context
OS: [e.g. Windows 99]
Web server [e.g. Apache 1.2.3]
PHP version [e.g. 6.5.4]
The text was updated successfully, but these errors were encountered:
No errors are reported even though error_reporting is set to the maximum value of -1.
That's because in PHP type-juggling is an integral part of the language until recently. It's not an error, it's a language feature.
In this particular case I don't see anything wrong with changing it. It's possible a few years ago I had other ideas about what to do with that variable. It's unsure.
Feel free to submit a PR. I believe we've told you that before.
I did not expect errors to be generated when declare(strict_types=1); was set/
You cannot expect that to be true when the framework was not developed for, and has no intention of using, strict typing. IIRC you maintain a fork that uses strict typing and that's great. To be brutally honest, though, it's not our place to fix issues that break due to something someone else does in their fork.
Describe the bug
I appreciate the reluctance not to use strict_types and if this small change is not allowed I would be grateful to know why the defined type parameter does not match the expected predefined function type parameter.
Numerous functions in the system folder have function parameter types specified and because declare(strict_types=1); is not set then the parameter types are type juggled. No errors are reported even though error_reporting is set to the maximum value of -1.
Changing these three files:
/app/config/Boot/development.php
/app/config/Boot/production.php
/app/config/Boot/testing.php // not tested :)
and defining CI_DEBUG to use boolean parameters instead of integers matches the parameters of "system/Log/Logger.php:155"
The following error log was generated when "system/Log/Logger.php" was declared(strict_types=1);
Uncaught TypeError:
Argument 2 passed to CodeIgniter\Log\Logger::__construct()
must be of the type boolean, integer given,
called in /var/www/ci2/ci4-strict-github/system/Config/Services.php on line 432
and
defined in /var/www/ci2/ci4-strict-github/system/Log/Logger.php:155 Stack trace:
CodeIgniter 4 version
Ver: 4.0.0-rc.2.1
Affected module(s)
system/Log/Logger.php
Expected behavior, and steps to reproduce if appropriate
I did not expect errors to be generated when declare(strict_types=1); was set/
Context
The text was updated successfully, but these errors were encountered: