feat: add the EnvironmentDetector utility class and environment service#10130
Conversation
michalsn
left a comment
There was a problem hiding this comment.
I think it's a good change.
I added some suggestions to the phpdocs / user guide.
7231481 to
86fe9de
Compare
86fe9de to
0549469
Compare
EnvironmentDetector utility class and environmentdetector serviceEnvironmentDetector utility class and envdetector service
0549469 to
8315469
Compare
|
Why not just use It's also aligned with the code we used to write: |
|
I have already said my opinion - for the environment, this can already be attributed to the DotEnv loader. Since the comparison with a constant looks clear, and the service is associated with all the features of $_ENV. The last word belongs to the members, I have less importance here. |
|
In this context, "environment" means the current CI runtime mode (
|
|
@michalsn thanks for the clarification. I know this, and I can always see what the code is doing in the system. It's more about the other participants. You can see the questions in the Issue/Forum ‐ someone mistakenly perceives the specifics of the framework or expects precise actions in the documentation (although everything looks clear to us). |
|
I see your point, but I don't find |
8315469 to
76586d4
Compare
EnvironmentDetector utility class and envdetector serviceEnvironmentDetector utility class and environment service
|
Thanks all for the reviews! |
Description
This PR adds the
EnvironmentDetectorutility class as a simple mockable wrapper to accessing theENVIRONMENTconstant, allowing us to test previously unreachable code branches dependent on the current environment.Checklist: