You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Split the Environment class into a contract and traits #614
Split the Environment class into a contract and traits, as other packages do, with no behavior change. The typed readers that go into the new contract are tracked separately in #615.
Why
Quantum\Environment\Environment is one 213-line class with five jobs: state and loading, the app environment name, reading values, writing .env, and locating and parsing the files. It has no interface, unlike Config and Mailer, and the readers planned in #615 need a contract to be defined in.
Proposed change
src/Environment/
├── Contracts/EnvironmentInterface.php
├── Environment.php state and load(), using the traits
├── Traits/
│ ├── AppEnvTrait.php getAppEnv(), isProduction(), isStaging(), isDevelopment(), isTesting(), isLocal()
│ ├── ValueTrait.php getValue(), hasKey(), getRow()
│ └── EnvFileTrait.php file lookup, parsing and updateRow()
├── Enums/, Exceptions/, Helpers/, Server.php
EnvironmentInterface declares every public method of the class. setMutable() returns EnvironmentInterface in the contract, and Environment keeps : Environment, which narrows it.
Environment keeps all its public methods, so environment(), env(), AppContext and the other users do not change.
changed the title [-]Split the Environment class into a contract and traits, and add typed readers[/-][+]Split the Environment class into a contract and traits[/+]on Oct 26, 2026
Activity
[-]Split the Environment class into a contract and traits, and add typed readers[/-][+]Split the Environment class into a contract and traits[/+]