-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor getenv access using constructor #9
base: master
Are you sure you want to change the base?
Refactor getenv access using constructor #9
Conversation
public function __construct(array $env = []) | ||
{ | ||
foreach (self::$envKeys as $key) { | ||
$this->env[$key] = array_key_exists($key, $env) ? $env[$key] : getenv($key); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possibly add an explicit string cast to $env[$key]
to mirror the values we'll be getting back from getenv
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$this->env
is never declared, so it's a public property.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
👍 (of course, I'm probably biased) |
2fdc5f5
to
84deaaf
Compare
Included CR feedback from @bobthecow |
Any news on this @dnoegel, @bobthecow, @bcremer? |
Another alternative to PR #6 and #7 including the idea of @bobthecow.