Skip to content

Use env_bool() and env_int() in the module template configs #617

Open

Description

@armanist

Summary

Use env_bool() and env_int() in the module template configs, so newly generated modules store real booleans and integers. Depends on #615.

Why

The templates store .env text for settings that are not text: 'two_fa' => env('TWO_FA', true) stores the string 'true' or 'false', and the lifetime and port settings store numeric text.

Files

  • DemoApi/src/config/auth.php.tpl and DemoWeb/src/config/auth.php.tpl: remember_lifetime becomes env_int('REMEMBER_LIFETIME', 2592000) and two_fa becomes env_bool('TWO_FA', true).
  • DemoApi/src/config/rate_limit.php.tpl: port becomes env_int('REDIS_PORT', 6379).

The other env() values in the templates are text and stay as they are.

Out of scope

  • Modules that were already generated; they keep their config.

Breaking changes

  • None. A generated module needs a framework that has env_bool() and env_int(), which is 3.1.2 or newer.

Acceptance criteria

  • the three templates use the helpers, and a module generated from each still boots and authenticates in the existing template tests
  • composer test, composer cs:check, composer phpstan and composer rector:check pass
  • the changelog lists the change

Activity

  1. added this to the 3.1.2 milestone on Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    tech debtTechnical debt reductiontemplatesShipped templates and scaffolding

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions