Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Added process of booleans #1

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

Merged
phpdevcommunity merged 3 commits into phpdevcommunity:main from jaumarar:process-booleans
Feb 17, 2021
Merged

Added process of booleans #1

phpdevcommunity merged 3 commits into phpdevcommunity:main from jaumarar:process-booleans
Feb 17, 2021

Conversation

Copy link
Contributor

@jaumarar jaumarar commented Feb 7, 2021

If the .env file has a boolean value it will be parsed into the correct type:

.env file:
VARIABLE=true

Before:
$_ENV['VARIABLE] = 'true';

Now:
$_ENV['VARIABLE] = true;

  • Also added test and make this option configurable via DotEnv::PROCESS_BOOLEANS.
  • Attribute @runInSeparateProcess has been added to the test to restart $_ENV variables

phpdevcommunity reacted with thumbs up emoji
Copy link
Owner

@phpdevcommunity phpdevcommunity left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I approve the changes but I have a few remarks:

  • In processValue declare argument type as string
  • In load function , is not necessary return the values that have been loaded into ENV

Thanks

Copy link
Contributor Author

Perfect, I think all changes have been made

phpdevcommunity reacted with thumbs up emoji

Copy link
Owner

Ok for me , thanks

@phpdevcommunity phpdevcommunity merged commit 7d1e192 into phpdevcommunity:main Feb 17, 2021
Copy link
Owner

You are forget to remove unit test about returns values :

/**
* @runInSeparateProcess
*/
public function testLoadReturnsValues()
{
$loaded = (new DotEnv($this->env('.env.return')))->load();

 $this->assertEquals('returned', $loaded['VALUE']);
 $this->assertEquals('returned', $_ENV['VALUE']);
}

test failed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@phpdevcommunity phpdevcommunity phpdevcommunity requested changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /