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

[Mailer] Make Transports and Mailer private properties read-only. #6

Conversation

OlivierKessler01
Copy link

Q A
Branch? 6.1
Bug fix? no
New feature? no
Deprecations? no
Tickets
License MIT
Doc PR

"In order to be able to read mailer transports configuration/details from the user space, allow the read of it."

Basically, I'm working on a project where developers could easily set-up production SMTP on their development environments. Therefore I wanted to add a second protection, hard-coded in our PHP logic relative to the sending of mails which prevents sending an email to any non-local domain. But it seems like their is no way to retrieve the transports configuration from inside my services, other than a really heavy use of reflection.

It occurred to me that making those properties read-only wouldn't hurt the initial intention of making them impossible to change at runtime by the user, but still making it possible to check their value.

read-only.

In order to be able to read mailer transports configuration/details from
the user space, allow the read of it.
@symfony-bot
Copy link

symfony-bot bot commented Dec 30, 2021

Thanks for your pull request! We love contributions.

However, this repository is what we call a "subtree split": a read-only copy of one directory of the main Symfony repository. It is used by Composer to allow developers to depend on specific Symfony components.

If you want to contribute, you should instead open a pull request on the main repository:

https://github.com/symfony/symfony

Thank you for your contribution!

PS: if you haven't already, please add tests, and beware that bug fixes should be submitted on the lowest maintained branch where they apply.

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.

1 participant