Passed
Branch master (60f76a)
by Eric
05:57
created
src/Email/SwiftAbstract.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@
 block discarded – undo
62 62
      * @param array $attachments
63 63
      * @param string $mail_type
64 64
      */
65
-    abstract public function getMessage(array $to, $from_email, $from_name, $subject, $message_body, array $attachments, $mail_type='html');
65
+    abstract public function getMessage(array $to, $from_email, $from_name, $subject, $message_body, array $attachments, $mail_type = 'html');
66 66
     
67 67
     /**
68 68
      * Wrapper to send the message
Please login to merge, or discard this patch.
src/Email/Swift5.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
     public function __construct($config = array())
35 35
     {
36 36
         $this->config = $config;
37
-        if( !class_exists('\Swift_Mailer') ) {
37
+        if (!class_exists('\Swift_Mailer')) {
38 38
             require_once dirname(__FILE__).'../../../vendor/swiftmailer/swiftmailer/lib/swift_required.php';
39 39
         }
40 40
     }
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
      */
46 46
     public function getMailer()
47 47
     {
48
-        if(is_null($this->mailer))
48
+        if (is_null($this->mailer))
49 49
         {
50 50
             if (isset($this->config['type']) && $this->config['type'] == 'smtp') {
51 51
                 $transport = \Swift_SmtpTransport::newInstance($this->config['smtp_options']['host'], $this->config['smtp_options']['port']);
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
      * (non-PHPdoc)
68 68
      * @see \JaegerApp\Email\SwiftAbstract::getMessage()
69 69
      */
70
-    public function getMessage(array $to, $from_email, $from_name, $subject, $message_body, array $attachments, $mail_type='html')
70
+    public function getMessage(array $to, $from_email, $from_name, $subject, $message_body, array $attachments, $mail_type = 'html')
71 71
     {
72 72
         $message = \Swift_Message::newInstance();
73 73
         $message->setTo($to);
Please login to merge, or discard this patch.
src/Email/Swift3.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
     
27 27
     public function getMailer()
28 28
     {
29
-        if(is_null($this->mailer))
29
+        if (is_null($this->mailer))
30 30
         {
31 31
             if (isset($this->config['type']) && $this->config['type'] == 'smtp') {
32 32
 
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
         return $this->mailer;
48 48
     }
49 49
     
50
-    public function getMessage(array $to, $from_email, $from_name, $subject, $message_body, array $attachments, $mail_type='html')
50
+    public function getMessage(array $to, $from_email, $from_name, $subject, $message_body, array $attachments, $mail_type = 'html')
51 51
     {
52 52
         $to_list = new \Swift_RecipientList();
53 53
         foreach ($to as $key => $addr) {
Please login to merge, or discard this patch.
src/Email.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -342,9 +342,9 @@  discard block
 block discarded – undo
342 342
     public function getMailer()
343 343
     {
344 344
         if (is_null($this->mailer)) {
345
-            if(class_exists('\Swift'))
345
+            if (class_exists('\Swift'))
346 346
             {
347
-                if(version_compare(\Swift::VERSION, 4, '<=') && version_compare(\Swift::VERSION, 3, '>='))
347
+                if (version_compare(\Swift::VERSION, 4, '<=') && version_compare(\Swift::VERSION, 3, '>='))
348 348
                 {
349 349
                     $mailer = new Email\Swift3($this->config);
350 350
                 }
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
             }
404 404
         }
405 405
         
406
-        if (! $valid_emails) {
406
+        if (!$valid_emails) {
407 407
             return;
408 408
         }
409 409
         
@@ -412,7 +412,7 @@  discard block
 block discarded – undo
412 412
         $body_message = $this->getView()->render($this->getMessage(), $vars);
413 413
         $message = $mailer->getMessage($valid_emails, $this->config['from_email'], $this->config['sender_name'], $subject, $body_message, $this->getAttachments(), $this->getMailtype());
414 414
         
415
-        if (! $mailer->send($message)) {
415
+        if (!$mailer->send($message)) {
416 416
             print_r($mailer->getMailer()->mailer_logger->dump());
417 417
             exit();
418 418
             throw new EmailException($this->getMailer()->ErrorInfo);
Please login to merge, or discard this patch.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -347,12 +347,10 @@
 block discarded – undo
347 347
                 if(version_compare(\Swift::VERSION, 4, '<=') && version_compare(\Swift::VERSION, 3, '>='))
348 348
                 {
349 349
                     $mailer = new Email\Swift3($this->config);
350
-                }
351
-                else {
350
+                } else {
352 351
                     $mailer = new Email\Swift5($this->config);
353 352
                 }
354
-            }
355
-            else {
353
+            } else {
356 354
                 $mailer = new Email\Swift5($this->config); 
357 355
             }
358 356
             
Please login to merge, or discard this patch.