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

Optimation MailjetTransport.php #17

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

kevinveenbirkenbach
Copy link

Like in issue #16 mentioned the following got optimized:

PHPDocs:

  • some @parameters are now declared
  • some @throws are now declared
  • some @returns contain now all possible return types
  • some @var use now absolute paths which can not be mapped by some IDE's e.g. (PHPStorm)

Logic:

  • Unnecessary logic got deleted

Variables:

  • $resultStatus is now deleted
  • $sendCount is now deleted

All tests are passed.

@@ -185,23 +189,13 @@ public function bulkSend(array $messages, &$failedRecipients = null) {
}
}
// Create mailjetClient
$mailjetClient = $this->createMailjetClient();

$this->createMailjetClient();
Copy link

Choose a reason for hiding this comment

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

This line has no effect at the moment. We create new client instance and throw it into space.

I suggest we move the creation of the client before the foreach loop and keep the is_null condition.

// Create mailjetClient
if (is_null($this->mailjetClient)) {
    $this->mailjetClient = $this->createMailjetClient();
}
foreach ($messages as $message) {
    // ...
}

This will have performance gain as well.

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