Skip to content

Commit

Permalink
Merge pull request #33 from mfn/mfn-protected
Browse files Browse the repository at this point in the history
Embrace extendability and make all private Transport methods protected
  • Loading branch information
vladsandu authored Sep 5, 2020
2 parents a8743e5 + 2e7ff33 commit b6dd7ba
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/Postmark/Transport.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public function send(Swift_Mime_SimpleMessage $message, &$failedRecipients = nul
* @param Swift_Mime_SimpleMessage $message
* @return int
*/
private function getRecipientCount(Swift_Mime_SimpleMessage $message) {
protected function getRecipientCount(Swift_Mime_SimpleMessage $message) {
return count(array_merge(
(array) $message->getTo(),
(array) $message->getCc(),
Expand All @@ -131,7 +131,7 @@ private function getRecipientCount(Swift_Mime_SimpleMessage $message) {
* @param array $emails
* @return array
*/
private function convertEmailsArray(array $emails) {
protected function convertEmailsArray(array $emails) {
$convertedEmails = array();
foreach ($emails as $email => $name) {
$convertedEmails[] = $name
Expand All @@ -150,7 +150,7 @@ private function convertEmailsArray(array $emails) {
* @param string $mimeType
* @return Swift_Mime_MimePart
*/
private function getMIMEPart(Swift_Mime_SimpleMessage $message, $mimeType) {
protected function getMIMEPart(Swift_Mime_SimpleMessage $message, $mimeType) {
foreach ($message->getChildren() as $part) {
if (strpos($part->getContentType(), $mimeType) === 0 && !($part instanceof \Swift_Mime_Attachment)) {
return $part;
Expand All @@ -164,7 +164,7 @@ private function getMIMEPart(Swift_Mime_SimpleMessage $message, $mimeType) {
* @param Swift_Mime_SimpleMessage $message
* @return object
*/
private function getMessagePayload(Swift_Mime_SimpleMessage $message) {
protected function getMessagePayload(Swift_Mime_SimpleMessage $message) {
$payload = [];

$this->processRecipients($payload, $message);
Expand All @@ -185,7 +185,7 @@ private function getMessagePayload(Swift_Mime_SimpleMessage $message) {
* @param Swift_Mime_SimpleMessage $message
* @return object
*/
private function processRecipients(&$payload, $message) {
protected function processRecipients(&$payload, $message) {
$payload['From'] = join(',', $this->convertEmailsArray($message->getFrom()));
if ($to = $message->getTo()) {
$payload['To'] = join(',', $this->convertEmailsArray($to));
Expand All @@ -211,7 +211,7 @@ private function processRecipients(&$payload, $message) {
* @param Swift_Mime_SimpleMessage $message
* @return object
*/
private function processMessageParts(&$payload, $message) {
protected function processMessageParts(&$payload, $message) {
//Get the primary message.
switch ($message->getContentType()) {
case 'text/html':
Expand Down Expand Up @@ -256,7 +256,7 @@ private function processMessageParts(&$payload, $message) {
* @param Swift_Mime_SimpleMessage $message
* @return object
*/
private function processHeaders(&$payload, $message) {
protected function processHeaders(&$payload, $message) {
$headers = [];

foreach ($message->getHeaders()->getAll() as $key => $value) {
Expand Down

0 comments on commit b6dd7ba

Please # to comment.