Completed
Pull Request — master (#10)
by Helpful
05:30 queued 03:33
created
code/CommentNotifier.php 1 patch
Braces   +9 added lines, -3 removed lines patch added patch discarded remove patch
@@ -14,7 +14,9 @@  discard block
 block discarded – undo
14 14
 	 */
15 15
 	public function onAfterPostComment(Comment $comment) {
16 16
 		$parent = $comment->getParent();
17
-		if(!$parent) return;
17
+		if(!$parent) {
18
+			return;
19
+		}
18 20
 		
19 21
 		// Ask parent to submit all recipients
20 22
 		$recipients = $parent->notificationRecipients($comment);
@@ -33,7 +35,9 @@  discard block
 block discarded – undo
33 35
 	 * @return boolean
34 36
 	 */
35 37
 	public function isValidEmail($email) {
36
-		if(!$email) return false;
38
+		if(!$email) {
39
+			return false;
40
+		}
37 41
 
38 42
 		$pcrePattern = '^[a-z0-9!#$%&\'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&\'*+/=?^_`{|}~-]+)*'
39 43
 			. '@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$';
@@ -61,7 +65,9 @@  discard block
 block discarded – undo
61 65
 		$to = $recipient instanceof Member
62 66
 			? $recipient->Email
63 67
 			: $recipient;
64
-		if(!$this->isValidEmail($to)) return;
68
+		if(!$this->isValidEmail($to)) {
69
+			return;
70
+		}
65 71
 
66 72
 		// Prepare the email
67 73
 		$email = new Email();
Please login to merge, or discard this patch.