Passed
Push — master ( 646b1f...d2cbbe )
by Malte
02:44
created
src/IMAP/Support/Masks/MessageMask.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
      * Get the message html body
30 30
      * @return null
31 31
      */
32
-    public function getHtmlBody(){
32
+    public function getHtmlBody() {
33 33
         $bodies = $this->parent->getBodies();
34 34
         if (!isset($bodies['html'])) {
35 35
             return null;
@@ -46,15 +46,15 @@  discard block
 block discarded – undo
46 46
      */
47 47
     public function getCustomHTMLBody($callback = false) {
48 48
         $body = $this->getHtmlBody();
49
-        if($body === null) return null;
49
+        if ($body === null) return null;
50 50
 
51 51
         if ($callback !== false) {
52 52
             $aAttachment = $this->parent->getAttachments();
53 53
             $aAttachment->each(function($oAttachment) use(&$body, $callback) {
54 54
                 /** @var Attachment $oAttachment */
55
-                if(is_callable($callback)) {
55
+                if (is_callable($callback)) {
56 56
                     $body = $callback($body, $oAttachment);
57
-                }elseif(is_string($callback)) {
57
+                }elseif (is_string($callback)) {
58 58
                     call_user_func($callback, [$body, $oAttachment]);
59 59
                 }
60 60
             });
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
      * @return string|null
71 71
      */
72 72
     public function getHTMLBodyWithEmbeddedBase64Images() {
73
-        return $this->getCustomHTMLBody(function($body, $oAttachment){
73
+        return $this->getCustomHTMLBody(function($body, $oAttachment) {
74 74
             /** @var \Webklex\IMAP\Attachment $oAttachment */
75 75
             if ($oAttachment->id && $oAttachment->getImgSrc() != null) {
76 76
                 $body = str_replace('cid:'.$oAttachment->id, $oAttachment->getImgSrc(), $body);
Please login to merge, or discard this patch.
src/IMAP/Query/Query.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
     public function __construct(Client $client, $charset = 'UTF-8') {
66 66
         $this->setClient($client);
67 67
 
68
-        if(config('imap.options.fetch') === IMAP::FT_PEEK) $this->leaveUnread();
68
+        if (config('imap.options.fetch') === IMAP::FT_PEEK) $this->leaveUnread();
69 69
 
70 70
         $this->charset = $charset;
71 71
         $this->query = collect();
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
     /**
76 76
      * Instance boot method for additional functionality
77 77
      */
78
-    protected function boot(){}
78
+    protected function boot() {}
79 79
 
80 80
     /**
81 81
      * Parse a given value
@@ -83,8 +83,8 @@  discard block
 block discarded – undo
83 83
      *
84 84
      * @return string
85 85
      */
86
-    protected function parse_value($value){
87
-        switch(true){
86
+    protected function parse_value($value) {
87
+        switch (true) {
88 88
             case $value instanceof \Carbon\Carbon:
89 89
                 $value = $value->format('d M y');
90 90
                 break;
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
      * @throws MessageSearchValidationException
102 102
      */
103 103
     protected function parse_date($date) {
104
-        if($date instanceof \Carbon\Carbon) return $date;
104
+        if ($date instanceof \Carbon\Carbon) return $date;
105 105
 
106 106
         try {
107 107
             $date = Carbon::parse($date);
@@ -150,9 +150,9 @@  discard block
 block discarded – undo
150 150
              * Don't set the charset if it isn't used - prevent strange outlook mail server errors
151 151
              * @see https://github.com/Webklex/laravel-imap/issues/100
152 152
              */
153
-            if($this->getCharset() === null){
153
+            if ($this->getCharset() === null) {
154 154
                 $available_messages = imap_search($this->getClient()->getConnection(), $this->getRawQuery(), IMAP::SE_UID);
155
-            }else{
155
+            } else {
156 156
                 $available_messages = imap_search($this->getClient()->getConnection(), $this->getRawQuery(), IMAP::SE_UID, $this->getCharset());
157 157
             }
158 158
 
@@ -161,13 +161,13 @@  discard block
 block discarded – undo
161 161
                 $available_messages = collect($available_messages);
162 162
                 $options = config('imap.options');
163 163
 
164
-                if(strtolower($options['fetch_order']) === 'desc'){
164
+                if (strtolower($options['fetch_order']) === 'desc') {
165 165
                     $available_messages = $available_messages->reverse();
166 166
                 }
167 167
 
168 168
                 $available_messages->forPage($this->page, $this->limit)->each(function($msgno, $msglist) use(&$messages, $options) {
169 169
                     $oMessage = new Message($msgno, $msglist, $this->getClient(), $this->getFetchOptions(), $this->getFetchBody(), $this->getFetchAttachment(), $this->getFetchFlags());
170
-                    switch ($options['message_key']){
170
+                    switch ($options['message_key']) {
171 171
                         case 'number':
172 172
                             $message_key = $oMessage->getMessageNo();
173 173
                             break;
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
      * @return \Illuminate\Pagination\LengthAwarePaginator
201 201
      * @throws GetMessagesFailedException
202 202
      */
203
-    public function paginate($per_page = 5, $page = null, $page_name = 'imap_page'){
203
+    public function paginate($per_page = 5, $page = null, $page_name = 'imap_page') {
204 204
         $this->page = $page > $this->page ? $page : $this->page;
205 205
         $this->limit = $per_page;
206 206
 
@@ -218,9 +218,9 @@  discard block
 block discarded – undo
218 218
             if (count($statement) == 1) {
219 219
                 $query .= $statement[0];
220 220
             } else {
221
-                if($statement[1] === null){
221
+                if ($statement[1] === null) {
222 222
                     $query .= $statement[0];
223
-                }else{
223
+                } else {
224 224
                     $query .= $statement[0].' "'.$statement[1].'"';
225 225
                 }
226 226
             }
@@ -250,7 +250,7 @@  discard block
 block discarded – undo
250 250
      * @return $this
251 251
      */
252 252
     public function limit($limit, $page = 1) {
253
-        if($page >= 1) $this->page = $page;
253
+        if ($page >= 1) $this->page = $page;
254 254
         $this->limit = $limit;
255 255
 
256 256
         return $this;
Please login to merge, or discard this patch.