Passed
Push — master ( 838105...654365 )
by Blizzz
18:53
created
apps/comments/lib/Notification/Notifier.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -71,34 +71,34 @@
 block discarded – undo
71 71
 	 * @throws \InvalidArgumentException When the notification was not prepared by a notifier
72 72
 	 */
73 73
 	public function prepare(INotification $notification, $languageCode) {
74
-		if($notification->getApp() !== 'comments') {
74
+		if ($notification->getApp() !== 'comments') {
75 75
 			throw new \InvalidArgumentException();
76 76
 		}
77 77
 		try {
78 78
 			$comment = $this->commentsManager->get($notification->getObjectId());
79
-		} catch(NotFoundException $e) {
79
+		} catch (NotFoundException $e) {
80 80
 			// needs to be converted to InvalidArgumentException, otherwise none Notifications will be shown at all
81 81
 			throw new \InvalidArgumentException('Comment not found', 0, $e);
82 82
 		}
83 83
 		$l = $this->l10nFactory->get('comments', $languageCode);
84 84
 		$displayName = $comment->getActorId();
85 85
 		$isDeletedActor = $comment->getActorType() === ICommentsManager::DELETED_USER;
86
-		if($comment->getActorType() === 'users') {
86
+		if ($comment->getActorType() === 'users') {
87 87
 			$commenter = $this->userManager->get($comment->getActorId());
88
-			if(!is_null($commenter)) {
88
+			if (!is_null($commenter)) {
89 89
 				$displayName = $commenter->getDisplayName();
90 90
 			}
91 91
 		}
92 92
 
93
-		switch($notification->getSubject()) {
93
+		switch ($notification->getSubject()) {
94 94
 			case 'mention':
95 95
 				$parameters = $notification->getSubjectParameters();
96
-				if($parameters[0] !== 'files') {
96
+				if ($parameters[0] !== 'files') {
97 97
 					throw new \InvalidArgumentException('Unsupported comment object');
98 98
 				}
99 99
 				$userFolder = $this->rootFolder->getUserFolder($notification->getUser());
100
-				$nodes = $userFolder->getById((int)$parameters[1]);
101
-				if(empty($nodes)) {
100
+				$nodes = $userFolder->getById((int) $parameters[1]);
101
+				if (empty($nodes)) {
102 102
 					throw new \InvalidArgumentException('Cannot resolve file ID to node instance');
103 103
 				}
104 104
 				$node = $nodes[0];
Please login to merge, or discard this patch.