@@ -25,29 +25,41 @@ public function __construct()
2525 public function generateMessage ($ toQuantity , $ ccQuantity = 0 , $ bccQuantity = 0 )
2626 {
2727 $ toQuantity = (int )$ toQuantity ;
28- if ($ toQuantity < 1 ) $ toQuantity = 1 ;
29- if ($ toQuantity > 20 ) $ toQuantity = 20 ;
28+ if ($ toQuantity < 1 ) {
29+ $ toQuantity = 1 ;
30+ }
31+ if ($ toQuantity > 20 ) {
32+ $ toQuantity = 20 ;
33+ }
3034 $ ccQuantity = (int )$ ccQuantity ;
31- if ($ ccQuantity < 0 ) $ ccQuantity = 0 ;
32- if ($ ccQuantity > 20 ) $ ccQuantity = 20 ;
35+ if ($ ccQuantity < 0 ) {
36+ $ ccQuantity = 0 ;
37+ }
38+ if ($ ccQuantity > 20 ) {
39+ $ ccQuantity = 20 ;
40+ }
3341 $ bccQuantity = (int )$ bccQuantity ;
34- if ($ bccQuantity < 0 ) $ bccQuantity = 0 ;
35- if ($ bccQuantity > 20 ) $ bccQuantity = 20 ;
42+ if ($ bccQuantity < 0 ) {
43+ $ bccQuantity = 0 ;
44+ }
45+ if ($ bccQuantity > 20 ) {
46+ $ bccQuantity = 20 ;
47+ }
3648 $ all = $ toQuantity + $ ccQuantity + $ bccQuantity ;
3749 $ recipients = $ this ->generateRecipients ($ all );
3850
3951 $ subject = $ this ->faker ->text (50 );
4052 $ text = $ this ->faker ->randomHtml ();
4153 $ message = new Message ($ subject , $ text , true );
42- for ($ n= 1 ; $ n<= $ toQuantity ; $ n ++) {
54+ for ($ n = 1 ; $ n <= $ toQuantity ; $ n ++) {
4355 $ recipient = array_shift ($ recipients );
4456 $ message ->addTo ($ recipient ["email " ], $ recipient ["name " ]);
4557 }
46- for ($ n= 1 ; $ n<= $ ccQuantity ; $ n ++) {
58+ for ($ n = 1 ; $ n <= $ ccQuantity ; $ n ++) {
4759 $ recipient = array_shift ($ recipients );
4860 $ message ->addCc ($ recipient ["email " ], $ recipient ["name " ]);
4961 }
50- for ($ n= 1 ; $ n<= $ bccQuantity ; $ n ++) {
62+ for ($ n = 1 ; $ n <= $ bccQuantity ; $ n ++) {
5163 $ recipient = array_shift ($ recipients );
5264 $ message ->addBcc ($ recipient ["email " ], $ recipient ["name " ]);
5365 }
@@ -58,8 +70,12 @@ public function generateMessage($toQuantity, $ccQuantity = 0, $bccQuantity = 0)
5870 public function generateRecipients ($ quantity )
5971 {
6072 $ quantity = (int )$ quantity ;
61- if ($ quantity < 1 ) $ quantity = 1 ;
62- if ($ quantity > 100 ) $ quantity = 100 ;
73+ if ($ quantity < 1 ) {
74+ $ quantity = 1 ;
75+ }
76+ if ($ quantity > 100 ) {
77+ $ quantity = 100 ;
78+ }
6379 $ recipients = array ();
6480 do {
6581 $ email = $ this ->faker ->email ;
@@ -72,4 +88,4 @@ public function generateRecipients($quantity)
7288 } while (count ($ recipients ) < $ quantity );
7389 return $ recipients ;
7490 }
75- }
91+ }
0 commit comments