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

Bug: CI_DEBUG incorrect type and fails strict validation #2975

Closed
John-Betong opened this issue May 11, 2020 · 1 comment · Fixed by #3011
Closed

Bug: CI_DEBUG incorrect type and fails strict validation #2975

John-Betong opened this issue May 11, 2020 · 1 comment · Fixed by #3011
Labels
enhancement PRs that improve existing functionalities

Comments

@John-Betong
Copy link

Adding the following script to index.php and to every single ./system PHP file makes the script compatible with the PHP Strict 7.?? source.

If and only if 'declare(strict_types=1)' is declared in the parent file will strict_types have any effect.

The following three files fail PHP strict validation because they "type juggle" to change the numeric to a bool:

Files:
./app/Config/Boot/development.php
./app/Config/Boot/production.php
./app/Config/Boot/testing.php

// FAIL
// defined('CI_DEBUG') || define('CI_DEBUG', 1);

// PASS:
defined('CI_DEBUG') || define('CI_DEBUG', TRUE);

These three small changes make it possible to render the Welcome page using PHP Strict Mode.

@John-Betong John-Betong added the bug Verified issues on the current code behavior or pull requests that will fix them label May 11, 2020
@lonnieezell lonnieezell added enhancement PRs that improve existing functionalities and removed bug Verified issues on the current code behavior or pull requests that will fix them labels May 11, 2020
@lonnieezell
Copy link
Member

Submit a PR and I'll be happy to merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement PRs that improve existing functionalities
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants