Add Zend\Mail\Transport\Factory #5470

Merged
merged 5 commits into from Nov 13, 2013

Conversation

Projects
None yet
3 participants
Contributor

stefanotorresi commented Nov 13, 2013

No description provided.

+ ));
+ }
+
+ $type = isset($spec['type']) ? $spec['type'] : 'sendmail';
@ThomasCantonnet

ThomasCantonnet Nov 13, 2013

Contributor

strtolower here instead of twice below?

@stefanotorresi

stefanotorresi Nov 13, 2013

Contributor

oops, i'll fix it right away!

library/Zend/Mail/Transport/Factory.php
+ if (isset(static::$classMap[strtolower($type)])) {
+ $type = static::$classMap[strtolower($type)];
+ }
+
@ThomasCantonnet

ThomasCantonnet Nov 13, 2013

Contributor

since from your code it seems that one can choose a type outside the $classmap array (eg custom class implementing TransportInterface), wouldn't it make more sense to remove this array and use namespaces instead ?

@stefanotorresi

stefanotorresi Nov 13, 2013

Contributor

That would prevent to use shortands type values for transports classes supplied by the framework OOTB.
This behavior is meant to be consistent with other static factories present in the framework (i.e. Zend\Captcha\Factory)

@ThomasCantonnet

ThomasCantonnet Nov 13, 2013

Contributor

fair enough :)

weierophinney added a commit that referenced this pull request Nov 13, 2013

weierophinney added a commit that referenced this pull request Nov 13, 2013

@weierophinney weierophinney merged commit fa9617b into zendframework:develop Nov 13, 2013

1 check passed

default The Travis CI build passed
Details

@ghost ghost assigned weierophinney Nov 13, 2013

@stefanotorresi stefanotorresi deleted the stefanotorresi:add/mail-transport-factory branch Nov 13, 2013

weierophinney added a commit to zendframework/zend-mail that referenced this pull request May 14, 2015

Merge pull request zendframework/zendframework#5470 from stefanotorre…
…si/add/mail-transport-factory

Add Zend\Mail\Transport\Factory

weierophinney added a commit to zendframework/zend-mail that referenced this pull request May 14, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment