Completed
Pull Request — master (#8)
by Helpful
02:07
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.
tests/CommentNotifiableTest.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -75,7 +75,9 @@
 block discarded – undo
75 75
 
76 76
 	public function notificationRecipients($comment) {
77 77
 		$author = $this->Author();
78
-		if($author && $author->exists()) return new ArrayList(array($author));
78
+		if($author && $author->exists()) {
79
+			return new ArrayList(array($author));
80
+		}
79 81
 		return parent::notificationRecipients($comment);
80 82
 	}
81 83
 
Please login to merge, or discard this patch.