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

Skip to content

[Notifier] [FakeSms] Allow missing optional dependency #48546

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
merged 1 commit into from
Dec 9, 2022

Conversation

benschoch
Copy link

@benschoch benschoch commented Dec 8, 2022

Q A
Branch? 6.3
Bug fix? no
New feature? yes
Deprecations? no
Tickets Fix #48441
License MIT

Allow the FakeSmsTransportFactory to be used without providing an implementation of MailerInterface or LoggerInterface if one of them is actually not required during runtime.

Same could be applied to the FakeChatTransportFactory if the provided approach is ok.

@carsonbot
Copy link

Hey!

I see that this is your first PR. That is great! Welcome!

Symfony has a contribution guide which I suggest you to read.

In short:

  • Always add tests
  • Keep backward compatibility (see https://symfony.com/bc).
  • Bug fixes must be submitted against the lowest maintained branch where they apply (see https://symfony.com/releases)
  • Features and deprecations must be submitted against the 6.3 branch.

Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change.

When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor!
If this PR is merged in a lower version branch, it will be merged up to all maintained branches within a few days.

I am going to sit back now and wait for the reviews.

Cheers!

Carsonbot

@benschoch benschoch force-pushed the optional_notifier_fakesms_dependency branch from e5bcf6e to ddf16cb Compare December 8, 2022 11:55
@OskarStark
Copy link
Contributor

OskarStark commented Dec 8, 2022

Thank you for your PR, that makes sense 👍

I think we should move symfony/mailer to require-dev and add a logger to require-dev?

@benschoch benschoch force-pushed the optional_notifier_fakesms_dependency branch from 0dda903 to 6291bf9 Compare December 8, 2022 13:13
@benschoch
Copy link
Author

Thanks for your feedback. I'll actually reverted the custom exception and moved the mentioned dependencies to require-dev.
I am not really sure about the exception message, but let me know what you think.

Copy link
Contributor

@OskarStark OskarStark left a comment

Choose a reason for hiding this comment

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

Test failure unrelated

@fabpot fabpot force-pushed the optional_notifier_fakesms_dependency branch from 6291bf9 to 88e6c3e Compare December 9, 2022 07:18
@fabpot
Copy link
Member

fabpot commented Dec 9, 2022

Thank you @benschoch.

@fabpot fabpot merged commit dc27349 into symfony:6.3 Dec 9, 2022
OskarStark added a commit that referenced this pull request Dec 9, 2022
…y (Benjamin Schoch)

This PR was merged into the 6.3 branch.

Discussion
----------

[Notifier] [FakeChat] Allow missing optional dependency

| Q             | A
| ------------- | ---
| Branch?       | 6.3
| Bug fix?      |no
| New feature?  | kind of
| Deprecations? | no
| Tickets       | see #48441
| License       | MIT

Nearly the same as in this PR: #48546

This allows the `FakeChatTransportFactory` to be used without providing an implementation of `MailerInterface` or `LoggerInterface` if one of them is actually not required during runtime.

I did not share any of the implementation now between both components. I could think of pulling out the Exception as well as Parts of the test to something like a `FakeTransportFactoryTestCase` for example. What do you think?

Commits
-------

3f312b8 [Notifier] [FakeChat] Allow missing optional dependency
@fabpot fabpot mentioned this pull request May 1, 2023
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.

Why fake-sms-notifier factory requires MailerInterface when this feature is not required?
5 participants