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

Skip to content

chore: remove unnecessary dependency on the Symfony mailer class #49

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 4 commits into from
Feb 20, 2023

Conversation

SamMousa
Copy link
Contributor

This removes the usage of the symfony mailer class. We did not use any of it's functionality.
We had a hard dependency on this class, but the code paths we used made it a very simple proxy. Since all usages were properly private there is no BC break.

First note the constructor of the class:

    public function __construct(TransportInterface $transport, MessageBusInterface $bus = null, EventDispatcherInterface $dispatcher = null)
    {
        $this->transport = $transport;
        $this->bus = $bus;
        $this->dispatcher = $dispatcher;
    }

We only ever called this with 1 argument, setting the transport.

Then note the only other function, which we also only ever call with 1 argument:

    public function send(RawMessage $message, Envelope $envelope = null): void
    {
        if (null === $this->bus) {
            $this->transport->send($message, $envelope);

            return;
        }
        // ... other  code omitted for brevity
   }

Since we never set the bus variable, we can skip this class altogether and directly have the transport send the message.

Q A
Is bugfix?
New feature?
Breaks BC?

@samdark samdark added this to the 3.0.1 milestone Feb 15, 2023
Copy link
Member

@samdark samdark left a comment

Choose a reason for hiding this comment

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

👍 Need a line for CHANGELOG.

@SamMousa
Copy link
Contributor Author

This is an internal only change; I don't think it should be in the CHANGELOG since it doesn't matter from a library consumer point of view.

@SamMousa
Copy link
Contributor Author

Changelog updated!

@samdark samdark merged commit 130dada into yiisoft:master Feb 20, 2023
@samdark
Copy link
Member

samdark commented Feb 20, 2023

👍

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.

2 participants