@@ -101,7 +101,7 @@ |
||
101 | 101 | 'key' => $this->getKey(), |
102 | 102 | 'value' => $this->getValue() |
103 | 103 | ], |
104 | - function ($value) { |
|
104 | + function($value) { |
|
105 | 105 | return $value !== null; |
106 | 106 | } |
107 | 107 | ) ?: null; |
@@ -73,7 +73,7 @@ |
||
73 | 73 | [ |
74 | 74 | 'enable' => $this->getEnable() |
75 | 75 | ], |
76 | - function ($value) { |
|
76 | + function($value) { |
|
77 | 77 | return $value !== null; |
78 | 78 | } |
79 | 79 | ) ?: null; |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | if (\is_array($subject) || $email->isPersonalized()) { |
126 | 126 | $personalization = new Personalization(); |
127 | 127 | $this->addTo($email, null, null, null, $personalization); |
128 | - } else { |
|
128 | + }else { |
|
129 | 129 | $this->addTo($email); |
130 | 130 | $personalization = \end($this->personalization); |
131 | 131 | } |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | foreach ($globalSubstitutions as $key => $value) { |
140 | 140 | if ($value instanceof Substitution) { |
141 | 141 | $personalization->addSubstitution($value); |
142 | - } else { |
|
142 | + }else { |
|
143 | 143 | $personalization->addSubstitution($key, $value); |
144 | 144 | } |
145 | 145 | } |
@@ -184,8 +184,8 @@ discard block |
||
184 | 184 | $personalizationIndex = null, |
185 | 185 | $personalization = null |
186 | 186 | ) { |
187 | - $personalizationFunctionCall = 'add' . $emailType; |
|
188 | - $emailTypeClass = '\SendGrid\Mail\\' . $emailType; |
|
187 | + $personalizationFunctionCall = 'add'.$emailType; |
|
188 | + $emailTypeClass = '\SendGrid\Mail\\'.$emailType; |
|
189 | 189 | if (!($email instanceof $emailTypeClass)) { |
190 | 190 | $email = new $emailTypeClass( |
191 | 191 | $email, |
@@ -231,7 +231,7 @@ discard block |
||
231 | 231 | $personalizationIndex = null, |
232 | 232 | $personalization = null |
233 | 233 | ) { |
234 | - $emailFunctionCall = 'add' . $emailType; |
|
234 | + $emailFunctionCall = 'add'.$emailType; |
|
235 | 235 | |
236 | 236 | if (\current($emails) instanceof EmailAddress) { |
237 | 237 | foreach ($emails as $email) { |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | $personalization |
244 | 244 | ); |
245 | 245 | } |
246 | - } else { |
|
246 | + }else { |
|
247 | 247 | foreach ($emails as $email => $name) { |
248 | 248 | $this->$emailFunctionCall( |
249 | 249 | $email, |
@@ -329,8 +329,8 @@ discard block |
||
329 | 329 | ($personalizationIndex > $personalizationCount) |
330 | 330 | ) { |
331 | 331 | throw new InvalidArgumentException( |
332 | - 'personalizationIndex ' . $personalizationIndex . |
|
333 | - ' must be less than ' . $personalizationCount |
|
332 | + 'personalizationIndex '.$personalizationIndex. |
|
333 | + ' must be less than '.$personalizationCount |
|
334 | 334 | ); |
335 | 335 | } |
336 | 336 | |
@@ -610,7 +610,7 @@ discard block |
||
610 | 610 | if ($key instanceof Header) { |
611 | 611 | $h = $key; |
612 | 612 | $header = new Header($h->getKey(), $h->getValue()); |
613 | - } else { |
|
613 | + }else { |
|
614 | 614 | $header = new Header($key, $value); |
615 | 615 | } |
616 | 616 | |
@@ -642,7 +642,7 @@ discard block |
||
642 | 642 | foreach ($headers as $header) { |
643 | 643 | $this->addHeader($header); |
644 | 644 | } |
645 | - } else { |
|
645 | + }else { |
|
646 | 646 | foreach ($headers as $key => $value) { |
647 | 647 | $this->addHeader( |
648 | 648 | $key, |
@@ -744,7 +744,7 @@ discard block |
||
744 | 744 | if ($key instanceof Substitution) { |
745 | 745 | $s = $key; |
746 | 746 | $substitution = new Substitution($s->getKey(), $s->getValue()); |
747 | - } else { |
|
747 | + }else { |
|
748 | 748 | $substitution = new Substitution($key, $value); |
749 | 749 | } |
750 | 750 | |
@@ -777,7 +777,7 @@ discard block |
||
777 | 777 | foreach ($substitutions as $substitution) { |
778 | 778 | $this->addSubstitution($substitution); |
779 | 779 | } |
780 | - } else { |
|
780 | + }else { |
|
781 | 781 | foreach ($substitutions as $key => $value) { |
782 | 782 | $this->addSubstitution( |
783 | 783 | $key, |
@@ -825,7 +825,7 @@ discard block |
||
825 | 825 | if ($key instanceof CustomArg) { |
826 | 826 | $ca = $key; |
827 | 827 | $custom_arg = new CustomArg($ca->getKey(), $ca->getValue()); |
828 | - } else { |
|
828 | + }else { |
|
829 | 829 | $custom_arg = new CustomArg($key, $value); |
830 | 830 | } |
831 | 831 | |
@@ -858,7 +858,7 @@ discard block |
||
858 | 858 | foreach ($custom_args as $custom_arg) { |
859 | 859 | $this->addCustomArg($custom_arg); |
860 | 860 | } |
861 | - } else { |
|
861 | + }else { |
|
862 | 862 | foreach ($custom_args as $key => $value) { |
863 | 863 | $this->addCustomArg( |
864 | 864 | $key, |
@@ -935,7 +935,7 @@ discard block |
||
935 | 935 | { |
936 | 936 | if ($email instanceof From) { |
937 | 937 | $this->from = $email; |
938 | - } else { |
|
938 | + }else { |
|
939 | 939 | Assert::email( |
940 | 940 | $email, |
941 | 941 | 'email', |
@@ -967,7 +967,7 @@ discard block |
||
967 | 967 | { |
968 | 968 | if ($email instanceof ReplyTo) { |
969 | 969 | $this->reply_to = $email; |
970 | - } else { |
|
970 | + }else { |
|
971 | 971 | $this->reply_to = new ReplyTo($email, $name); |
972 | 972 | } |
973 | 973 | } |
@@ -1026,7 +1026,7 @@ discard block |
||
1026 | 1026 | { |
1027 | 1027 | if ($type instanceof Content) { |
1028 | 1028 | $content = $type; |
1029 | - } else { |
|
1029 | + }else { |
|
1030 | 1030 | $content = new Content($type, $value); |
1031 | 1031 | } |
1032 | 1032 | $this->contents[] = $content; |
@@ -1046,7 +1046,7 @@ discard block |
||
1046 | 1046 | foreach ($contents as $content) { |
1047 | 1047 | $this->addContent($content); |
1048 | 1048 | } |
1049 | - } else { |
|
1049 | + }else { |
|
1050 | 1050 | foreach ($contents as $key => $value) { |
1051 | 1051 | $this->addContent($key, $value); |
1052 | 1052 | } |
@@ -1111,7 +1111,7 @@ discard block |
||
1111 | 1111 | $attachment[3], |
1112 | 1112 | $attachment[4] |
1113 | 1113 | ); |
1114 | - } else if (!($attachment instanceof Attachment)) { |
|
1114 | + }else if (!($attachment instanceof Attachment)) { |
|
1115 | 1115 | $attachment = new Attachment( |
1116 | 1116 | $attachment, |
1117 | 1117 | $type, |
@@ -1186,7 +1186,7 @@ discard block |
||
1186 | 1186 | $this->sections[$section->getKey()] = $section->getValue(); |
1187 | 1187 | return; |
1188 | 1188 | } |
1189 | - $this->sections[$key] = (string)$value; |
|
1189 | + $this->sections[$key] = (string) $value; |
|
1190 | 1190 | } |
1191 | 1191 | |
1192 | 1192 | /** |
@@ -1201,7 +1201,7 @@ discard block |
||
1201 | 1201 | foreach ($sections as $section) { |
1202 | 1202 | $this->addSection($section); |
1203 | 1203 | } |
1204 | - } else { |
|
1204 | + }else { |
|
1205 | 1205 | foreach ($sections as $key => $value) { |
1206 | 1206 | $this->addSection($key, $value); |
1207 | 1207 | } |
@@ -1234,7 +1234,7 @@ discard block |
||
1234 | 1234 | $this->headers[$header->getKey()] = $header->getValue(); |
1235 | 1235 | return; |
1236 | 1236 | } |
1237 | - $this->headers[$key] = (string)$value; |
|
1237 | + $this->headers[$key] = (string) $value; |
|
1238 | 1238 | } |
1239 | 1239 | |
1240 | 1240 | /** |
@@ -1252,7 +1252,7 @@ discard block |
||
1252 | 1252 | foreach ($headers as $header) { |
1253 | 1253 | $this->addGlobalHeader($header); |
1254 | 1254 | } |
1255 | - } else { |
|
1255 | + }else { |
|
1256 | 1256 | foreach ($headers as $key => $value) { |
1257 | 1257 | $this->addGlobalHeader($key, $value); |
1258 | 1258 | } |
@@ -1303,7 +1303,7 @@ discard block |
||
1303 | 1303 | foreach ($substitutions as $substitution) { |
1304 | 1304 | $this->addGlobalSubstitution($substitution); |
1305 | 1305 | } |
1306 | - } else { |
|
1306 | + }else { |
|
1307 | 1307 | foreach ($substitutions as $key => $value) { |
1308 | 1308 | $this->addGlobalSubstitution($key, $value); |
1309 | 1309 | } |
@@ -1332,7 +1332,7 @@ discard block |
||
1332 | 1332 | $category = new Category($category); |
1333 | 1333 | } |
1334 | 1334 | |
1335 | - Assert::accept($category, 'category', function () { |
|
1335 | + Assert::accept($category, 'category', function() { |
|
1336 | 1336 | $categories = $this->categories; |
1337 | 1337 | if (!\is_array($categories)) { |
1338 | 1338 | $categories = []; |
@@ -1382,7 +1382,7 @@ discard block |
||
1382 | 1382 | $this->custom_args[$custom_arg->getKey()] = $custom_arg->getValue(); |
1383 | 1383 | return; |
1384 | 1384 | } |
1385 | - $this->custom_args[$key] = (string)$value; |
|
1385 | + $this->custom_args[$key] = (string) $value; |
|
1386 | 1386 | } |
1387 | 1387 | |
1388 | 1388 | /** |
@@ -1400,7 +1400,7 @@ discard block |
||
1400 | 1400 | foreach ($custom_args as $custom_arg) { |
1401 | 1401 | $this->addGlobalCustomArg($custom_arg); |
1402 | 1402 | } |
1403 | - } else { |
|
1403 | + }else { |
|
1404 | 1404 | foreach ($custom_args as $key => $value) { |
1405 | 1405 | $this->addGlobalCustomArg($key, $value); |
1406 | 1406 | } |
@@ -1485,7 +1485,7 @@ discard block |
||
1485 | 1485 | if ($group_id instanceof Asm) { |
1486 | 1486 | $asm = $group_id; |
1487 | 1487 | $this->asm = $asm; |
1488 | - } else { |
|
1488 | + }else { |
|
1489 | 1489 | $this->asm = new Asm($group_id, $groups_to_display); |
1490 | 1490 | } |
1491 | 1491 | } |
@@ -1512,7 +1512,7 @@ discard block |
||
1512 | 1512 | { |
1513 | 1513 | if ($ip_pool_name instanceof IpPoolName) { |
1514 | 1514 | $this->ip_pool_name = $ip_pool_name->getIpPoolName(); |
1515 | - } else { |
|
1515 | + }else { |
|
1516 | 1516 | $this->ip_pool_name = new IpPoolName($ip_pool_name); |
1517 | 1517 | } |
1518 | 1518 | } |
@@ -1965,7 +1965,7 @@ discard block |
||
1965 | 1965 | [ |
1966 | 1966 | 'personalizations' => array_values(array_filter( |
1967 | 1967 | $this->getPersonalizations(), |
1968 | - static function ($value) { |
|
1968 | + static function($value) { |
|
1969 | 1969 | return null !== $value && null !== $value->jsonSerialize(); |
1970 | 1970 | } |
1971 | 1971 | )), |
@@ -1987,7 +1987,7 @@ discard block |
||
1987 | 1987 | 'mail_settings' => $this->getMailSettings(), |
1988 | 1988 | 'tracking_settings' => $this->getTrackingSettings() |
1989 | 1989 | ], |
1990 | - static function ($value) { |
|
1990 | + static function($value) { |
|
1991 | 1991 | return $value !== null; |
1992 | 1992 | } |
1993 | 1993 | ) ?: null; |
@@ -99,7 +99,7 @@ |
||
99 | 99 | 'enable' => $this->getEnable(), |
100 | 100 | 'enable_text' => $this->getEnableText() |
101 | 101 | ], |
102 | - function ($value) { |
|
102 | + function($value) { |
|
103 | 103 | return $value !== null; |
104 | 104 | } |
105 | 105 | ) ?: null; |
@@ -188,7 +188,7 @@ |
||
188 | 188 | 'name' => $this->getName(), |
189 | 189 | 'email' => $this->getEmail() |
190 | 190 | ], |
191 | - function ($value) { |
|
191 | + function($value) { |
|
192 | 192 | return $value !== null; |
193 | 193 | } |
194 | 194 | ) ?: null; |
@@ -209,7 +209,7 @@ |
||
209 | 209 | 'html' => $this->getHtml(), |
210 | 210 | 'substitution_tag' => $this->getSubstitutionTag() |
211 | 211 | ], |
212 | - function ($value) { |
|
212 | + function($value) { |
|
213 | 213 | return $value !== null; |
214 | 214 | } |
215 | 215 | ) ?: null; |
@@ -390,7 +390,7 @@ |
||
390 | 390 | 'sandbox_mode' => $this->getSandboxMode(), |
391 | 391 | 'spam_check' => $this->getSpamCheck() |
392 | 392 | ], |
393 | - function ($value) { |
|
393 | + function($value) { |
|
394 | 394 | return $value !== null; |
395 | 395 | } |
396 | 396 | ) ?: null; |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | { |
234 | 234 | Assert::isInstanceOf($custom_arg, 'custom_arg', CustomArg::class); |
235 | 235 | |
236 | - $this->custom_args[$custom_arg->getKey()] = (string)$custom_arg->getValue(); |
|
236 | + $this->custom_args[$custom_arg->getKey()] = (string) $custom_arg->getValue(); |
|
237 | 237 | } |
238 | 238 | |
239 | 239 | /** |
@@ -305,7 +305,7 @@ discard block |
||
305 | 305 | if ($this->getHasDynamicTemplate()) { |
306 | 306 | $dynamic_substitutions = $this->getSubstitutions(); |
307 | 307 | $substitutions = null; |
308 | - } else { |
|
308 | + }else { |
|
309 | 309 | $substitutions = $this->getSubstitutions(); |
310 | 310 | $dynamic_substitutions = null; |
311 | 311 | } |
@@ -323,7 +323,7 @@ discard block |
||
323 | 323 | 'custom_args' => $this->getCustomArgs(), |
324 | 324 | 'send_at' => $this->getSendAt() |
325 | 325 | ], |
326 | - static function ($value) { |
|
326 | + static function($value) { |
|
327 | 327 | return $value !== null; |
328 | 328 | } |
329 | 329 | ) ?: null; |
@@ -148,7 +148,7 @@ |
||
148 | 148 | 'threshold' => $this->getThreshold(), |
149 | 149 | 'post_to_url' => $this->getPostToUrl() |
150 | 150 | ], |
151 | - function ($value) { |
|
151 | + function($value) { |
|
152 | 152 | return $value !== null; |
153 | 153 | } |
154 | 154 | ) ?: null; |