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] Extract transport factory and allow create custom transports #31946

Draft
wants to merge 2 commits into
base: 4.4
from

Conversation

Projects
None yet
5 participants
@Koc
Copy link
Contributor

commented Jun 7, 2019

Q A
Branch? 4.4
Bug fix? no
New feature? yes
BC breaks? yes
Deprecations? no
Tests pass? not yet
Fixed tickets #31385
License MIT
Doc PR TBD

Alternative approach to allow create custom transports and register DSN for it. Replaces #31931, #31935 . Similar to already existent TansportFactory from Messenger.

This is draft, so please, ignore CS violations and missing license header.

namespace Symfony\Component\Mailer\Transport;
use Psr\Log\LoggerInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;

This comment has been minimized.

Copy link
@nicolas-grekas

nicolas-grekas Jun 8, 2019

Member

if you can use the one from Contracts its better

This comment has been minimized.

Copy link
@Koc

Koc Jun 8, 2019

Author Contributor

I've created separate PR for that: #31956

fabpot added a commit that referenced this pull request Jun 11, 2019

feature #31956 [Mailer] Changed EventDispatcherInterface dependency f…
…rom Component to Contracts (Koc)

This PR was merged into the 4.4 branch.

Discussion
----------

[Mailer] Changed EventDispatcherInterface dependency from Component to Contracts

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | yes
| Deprecations? | no
| Tests pass?   | almost yes, see #31956 (comment)
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Follow up of #31946 (comment) . I hope this kind of changes are allowed for experimental components.

BTW, @nicolas-grekas , why Psr14 interface is optional for Contract's `EventDispatcherInterface https://github.com/symfony/symfony/blob/4.4/src/Symfony/Contracts/EventDispatcher/EventDispatcherInterface.php#L16 ?

Commits
-------

bdb6217 Changed EventDispatcherInterface dependency from Component to Contracts

@Koc Koc force-pushed the Koc:mailer-transport-factory branch 2 times, most recently from 10b6b53 to 816f403 Jun 11, 2019

@Koc Koc force-pushed the Koc:mailer-transport-factory branch from 816f403 to 9af7d94 Jun 11, 2019

private $options;
public function __construct(string $scheme, string $host, ?int $port, string $user, string $pass, array $options = [])
{

This comment has been minimized.

Copy link
@onEXHovia

onEXHovia Jun 12, 2019

Port argument optional to maybe move it to the end?

* @author Konstantin Myakshin <molodchick@gmail.com>
*/
class NullTransportFactory extends AbstractTransportFactory
{

This comment has been minimized.

Copy link
@onEXHovia

onEXHovia Jun 12, 2019

Mark all TransportFactory how final?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.