quantum-php-project icon indicating copy to clipboard operation
quantum-php-project copied to clipboard

Use env_bool() and env_int() in the starter project config

Open armanist opened this issue 1 month ago • 0 comments

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: debug becomes env_bool('DEBUG', true) and resource_cache becomes env_bool('RESOURCE_CACHE', false).
  • shared/config/mailer.php: port becomes env_int('MAIL_PORT', 25).
  • shared/config/rate_limit.php: the Redis port becomes env_int('REDIS_PORT', 6379).

Notes

  • The helpers exist from quantum/framework 3.1.2, so composer.json has to require ^3.1.2 in the same change.
  • The MAIL_PORT default 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.json requires quantum/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

armanist avatar Oct 26 '26 09:10 armanist