Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[DependencyInjection] Use more clear message when unused environment variables detected #22976

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

Closed
wants to merge 2 commits into from
Closed

[DependencyInjection] Use more clear message when unused environment variables detected #22976

wants to merge 2 commits into from

Conversation

voronkovich
Copy link
Contributor

@voronkovich voronkovich commented May 30, 2017

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

Old error message:

Incompatible use of dynamic environment variables "DATABASE_URL", "MAILER_URL" found in parameters.

New error message:

Environment variables "DATABASE_URL", "MAILER_URL" are never used. Please, check your container's configuration.

@nicolas-grekas
Copy link
Member

shound't this be for 3.2?

@voronkovich voronkovich changed the base branch from master to 3.2 May 31, 2017 12:00
@voronkovich voronkovich changed the base branch from 3.2 to master May 31, 2017 12:02
@voronkovich voronkovich changed the base branch from master to 3.2 May 31, 2017 12:26
@voronkovich
Copy link
Contributor Author

@nicolas-grekas, I've changed the branch to 3.2

@voronkovich voronkovich reopened this May 31, 2017
@nicolas-grekas nicolas-grekas added this to the 3.2 milestone May 31, 2017
@@ -18,8 +18,8 @@
*/
class EnvParameterException extends InvalidArgumentException
{
public function __construct(array $usedEnvs, \Exception $previous = null)
public function __construct(array $envs, $message, \Exception $previous = null)
Copy link
Member

Choose a reason for hiding this comment

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

in order to not break BC, the $message arg should be added last, and should be optional ($message = 'Incompatible...')

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@nicolas-grekas, You're right. Fixed.

Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

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

👍

@fabpot
Copy link
Member

fabpot commented Jun 3, 2017

Thank you @voronkovich.

fabpot added a commit that referenced this pull request Jun 3, 2017
…nvironment variables detected (voronkovich)

This PR was squashed before being merged into the 3.2 branch (closes #22976).

Discussion
----------

[DependencyInjection] Use more clear message when unused environment variables detected

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

Old error message:
```
Incompatible use of dynamic environment variables "DATABASE_URL", "MAILER_URL" found in parameters.
```

New error message:
```
Environment variables "DATABASE_URL", "MAILER_URL" are never used. Please, check your container's configuration.
```

Commits
-------

6dbdb1b [DependencyInjection] Use more clear message when unused environment variables detected
@fabpot fabpot closed this Jun 3, 2017
@fabpot fabpot mentioned this pull request Jun 6, 2017
@fabpot fabpot mentioned this pull request Jul 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants