quantum-php-project
quantum-php-project copied to clipboard
Use env_bool() and env_int() in the starter project config
Summary
Use env_bool() and env_int() in the starter project's config, so a new project stores real booleans and integers. Depends on quantum-php/framework#615.
Why
shared/config/app.php stores .env text for settings that are not text: 'debug' => env('DEBUG', true) is the string 'true' or 'false' whenever .env has a DEBUG line, and 'port' => env('MAIL_PORT') is numeric text.
Files
shared/config/app.php:debugbecomesenv_bool('DEBUG', true)andresource_cachebecomesenv_bool('RESOURCE_CACHE', false).shared/config/mailer.php:portbecomesenv_int('MAIL_PORT', 25).shared/config/rate_limit.php: the Redisportbecomesenv_int('REDIS_PORT', 6379).
Notes
- The helpers exist from
quantum/framework3.1.2, socomposer.jsonhas to require^3.1.2in the same change. - The
MAIL_PORTdefault of 25 is the standard SMTP port; check it against the current behavior before using it.
Breaking changes
- None for new projects. Existing projects keep their config.
Acceptance criteria
- the four settings use the helpers, and
composer.jsonrequiresquantum/framework^3.1.2 composer cs:check,composer phpstan,composer rector:check, the tests and the API smoke test pass on PHP 8.1 to 8.3- the changelog lists the change