Skip to content

refactor(config): extract shared environment detection logic #14

@usernane

Description

@usernane

Description

Environment detection logic is duplicated in both HandlerConfig and SecurityConfig. Should be extracted to a shared utility.

Implementation Details

  • Create EnvironmentDetector class in WebFiori\Error\Config
  • Move detection logic (checking APP_ENV, display_errors, PRODUCTION constant) to this class
  • Update HandlerConfig and SecurityConfig to use EnvironmentDetector
  • Consider caching the detected environment

Acceptance Criteria

  • Single source of truth for environment detection
  • No duplicated detection logic
  • Both config classes use shared detector
  • Existing tests still pass

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions