Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Allow iterator as parameter for Zend\Mail\Transport\Smtp constructor #4999

Conversation

coolmic
Copy link
Contributor

@coolmic coolmic commented Aug 21, 2013

I guess it is a simple oversight.

@@ -50,7 +50,7 @@ class Smtp implements TransportInterface
public function __construct(SmtpOptions $options = null)
{
if (!$options instanceof SmtpOptions) {
$options = new SmtpOptions();
$options = new SmtpOptions($options);
Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't make any sense. According the the strict-type in line 50, $options must be either of type SmtpOptions or null. If $options is not an instance of SmtpOptions, then it must be null. Therefore, why would you pass it into new SmtpOptions?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh right, I didn't see the strict parameter in line 50.

I am accustomed to use array instead of WhateverOptions.

It use "instanceof" checking instead of "null === $var".
So I thought the author wanted to allow either array, or instanceof SmtpOptions as parameter.

@coolmic coolmic closed this Aug 21, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants