Skip to content

docs(config): add warn about invalid characters in env name #20875

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

Conversation

damienfern
Copy link
Contributor

No description provided.

@carsonbot carsonbot added this to the 7.3 milestone Apr 10, 2025
@damienfern damienfern changed the base branch from 7.3 to 6.4 April 10, 2025 13:00
Comment on lines +597 to +602
.. warning::

Some characters are not allowed in environment name, e.g. the
``-`` character. If you try to use it, it will throw this exception:
The environment "%s" contains invalid characters, it can only contain
characters allowed in PHP class names.
Copy link
Contributor

Choose a reason for hiding this comment

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

I’m not sure we really need to document this — from my point of view, the exception is clear enough.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The reason of this PR is that I got surprised that the doc did not mention it, and devs could easily use kebab-case for their environment name (especially on infrastructures they can't use locally).

But I agree, the exception is self-explanatory and devs will face this only once.

@OskarStark OskarStark modified the milestones: 7.3, 6.4 Apr 10, 2025
@javiereguiluz
Copy link
Member

Damien, your contribution is technically correct and we appreciate it 🙏

However, as Oskar mentioned, when the Symfony code triggers a crystal-clear exception with an easy to understand message and actionable instructions to fix it, we prefer to not document those details because it reduces the "noise" in the docs.

So, we're closing this PR without merging for that reason. I hope you understand it.

@damienfern damienfern deleted the docs/kernel-invalid-character-env-name branch April 14, 2025 08:48
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.

4 participants