Skip to content
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

[DI] Impossible to set an environment variable and then an array as container parameter #25333

Closed
wants to merge 9 commits into from

Conversation

Phantas0s
Copy link
Contributor

Q A
Branch? 3.3
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #25245
License MIT

When an environment variables and then an array is set as container parameters, an error is thrown (Warning: stripos() expects parameter 1 to be string, array given).

You can run my test without the fix in the Container builder to see it.

@Phantas0s Phantas0s changed the title 3.3 [DI] Impossible to set an environment variable and then an array as container parameter Dec 5, 2017
@ro0NL
Copy link
Contributor

ro0NL commented Dec 5, 2017

Could you change the base branch of your PR to 3.3?

@nicolas-grekas nicolas-grekas changed the base branch from master to 3.3 December 5, 2017 13:47
@nicolas-grekas
Copy link
Member

Could you change the base branch of your PR to 3.3?

done :)
but actually, a rebase is now needed @Phantas0s : we don't merge PRs that have merge commits.

Copy link
Contributor

@ro0NL ro0NL left a comment

Choose a reason for hiding this comment

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

change LGTM

@@ -615,6 +615,20 @@ public function testResolveEnvValues()
unset($_ENV['DUMMY_ENV_VAR'], $_SERVER['DUMMY_SERVER_VAR'], $_SERVER['HTTP_DUMMY_VAR']);
}

public function testResolveEnvValuesWithArray()
Copy link
Contributor

Choose a reason for hiding this comment

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

risky test btw.. needs an assertion.

Copy link
Contributor

Choose a reason for hiding this comment

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

You definitely need to assert something.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did some assertions. Sorry for that.

@@ -615,6 +615,20 @@ public function testResolveEnvValues()
unset($_ENV['DUMMY_ENV_VAR'], $_SERVER['DUMMY_SERVER_VAR'], $_SERVER['HTTP_DUMMY_VAR']);
}

public function testResolveEnvValuesWithArray()
Copy link
Contributor

Choose a reason for hiding this comment

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

You definitely need to assert something.

@Phantas0s
Copy link
Contributor Author

Sorry I definitely didn't follow correctly the guideline for pull request... I will do better next time :)

@fabpot
Copy link
Member

fabpot commented Dec 11, 2017

Thank you @Phantas0s.

fabpot added a commit that referenced this pull request Dec 11, 2017
… array as container parameter (Phantas0s)

This PR was squashed before being merged into the 3.3 branch (closes #25333).

Discussion
----------

[DI] Impossible to set an environment variable and then an array as container parameter

| Q             | A
| ------------- | ---
| Branch?       | 3.3
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #25245
| License       | MIT

When an environment variables and then an array is set as container parameters, an error is thrown (Warning: stripos() expects parameter 1 to be string, array given).

You can run my test without the fix in the Container builder to see it.

Commits
-------

484a082 [DI] Impossible to set an environment variable and then an array as container parameter
@fabpot fabpot closed this Dec 11, 2017
This was referenced Dec 15, 2017
@fabpot fabpot mentioned this pull request Jan 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants