@@ -55,15 +55,15 @@ discard block |
||
55 | 55 | $comment = $event->getComment(); |
56 | 56 | |
57 | 57 | $mentions = $this->extractMentions($comment->getMentions()); |
58 | - if(empty($mentions)) { |
|
58 | + if (empty($mentions)) { |
|
59 | 59 | // no one to notify |
60 | 60 | return; |
61 | 61 | } |
62 | 62 | |
63 | 63 | $notification = $this->instantiateNotification($comment); |
64 | 64 | |
65 | - foreach($mentions as $uid) { |
|
66 | - if( ($comment->getActorType() === 'users' && $uid === $comment->getActorId()) |
|
65 | + foreach ($mentions as $uid) { |
|
66 | + if (($comment->getActorType() === 'users' && $uid === $comment->getActorId()) |
|
67 | 67 | || !$this->userManager->userExists($uid) |
68 | 68 | ) { |
69 | 69 | // do not notify unknown users or yourself |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | } |
72 | 72 | |
73 | 73 | $notification->setUser($uid); |
74 | - if( $event->getEvent() === CommentsEvent::EVENT_DELETE |
|
74 | + if ($event->getEvent() === CommentsEvent::EVENT_DELETE |
|
75 | 75 | || $event->getEvent() === CommentsEvent::EVENT_PRE_UPDATE) |
76 | 76 | { |
77 | 77 | $this->notificationManager->markProcessed($notification); |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | $notification |
93 | 93 | ->setApp('comments') |
94 | 94 | ->setObject('comment', $comment->getId()) |
95 | - ->setSubject('mention', [ $comment->getObjectType(), $comment->getObjectId() ]) |
|
95 | + ->setSubject('mention', [$comment->getObjectType(), $comment->getObjectId()]) |
|
96 | 96 | ->setDateTime($comment->getCreationDateTime()); |
97 | 97 | |
98 | 98 | return $notification; |
@@ -105,12 +105,12 @@ discard block |
||
105 | 105 | * @return string[] containing the mentions, e.g. ['alice', 'bob'] |
106 | 106 | */ |
107 | 107 | public function extractMentions(array $mentions) { |
108 | - if(empty($mentions)) { |
|
108 | + if (empty($mentions)) { |
|
109 | 109 | return []; |
110 | 110 | } |
111 | 111 | $uids = []; |
112 | - foreach($mentions as $mention) { |
|
113 | - if($mention['type'] === 'user') { |
|
112 | + foreach ($mentions as $mention) { |
|
113 | + if ($mention['type'] === 'user') { |
|
114 | 114 | $uids[] = $mention['id']; |
115 | 115 | } |
116 | 116 | } |
@@ -51,13 +51,13 @@ discard block |
||
51 | 51 | * @param CommentsEvent $event |
52 | 52 | */ |
53 | 53 | public function handle(CommentsEvent $event) { |
54 | - if($event->getComment()->getObjectType() !== 'files') { |
|
54 | + if ($event->getComment()->getObjectType() !== 'files') { |
|
55 | 55 | // this is a 'files'-specific Handler |
56 | 56 | return; |
57 | 57 | } |
58 | 58 | |
59 | 59 | $eventType = $event->getEvent(); |
60 | - if( $eventType === CommentsEvent::EVENT_ADD |
|
60 | + if ($eventType === CommentsEvent::EVENT_ADD |
|
61 | 61 | ) { |
62 | 62 | $this->notificationHandler($event); |
63 | 63 | $this->activityHandler($event); |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | CommentsEvent::EVENT_UPDATE, |
70 | 70 | CommentsEvent::EVENT_DELETE, |
71 | 71 | ]; |
72 | - if(in_array($eventType, $applicableEvents)) { |
|
72 | + if (in_array($eventType, $applicableEvents)) { |
|
73 | 73 | $this->notificationHandler($event); |
74 | 74 | return; |
75 | 75 | } |
@@ -117,7 +117,7 @@ |
||
117 | 117 | \OC_Util::setupFS($user); |
118 | 118 | |
119 | 119 | // Check if this user has a trashbin directory |
120 | - $view = new \OC\Files\View('/' . $user); |
|
120 | + $view = new \OC\Files\View('/'.$user); |
|
121 | 121 | if (!$view->is_dir('/files_trashbin/files')) { |
122 | 122 | return false; |
123 | 123 | } |
@@ -107,8 +107,8 @@ |
||
107 | 107 | protected function removeDeletedFiles($uid) { |
108 | 108 | \OC_Util::tearDownFS(); |
109 | 109 | \OC_Util::setupFS($uid); |
110 | - if ($this->rootFolder->nodeExists('/' . $uid . '/files_trashbin')) { |
|
111 | - $this->rootFolder->get('/' . $uid . '/files_trashbin')->delete(); |
|
110 | + if ($this->rootFolder->nodeExists('/'.$uid.'/files_trashbin')) { |
|
111 | + $this->rootFolder->get('/'.$uid.'/files_trashbin')->delete(); |
|
112 | 112 | $query = $this->dbConnection->getQueryBuilder(); |
113 | 113 | $query->delete('files_trash') |
114 | 114 | ->where($query->expr()->eq('user', $query->createParameter('uid'))) |
@@ -59,7 +59,7 @@ |
||
59 | 59 | * @param string $value |
60 | 60 | * @return bool |
61 | 61 | */ |
62 | - public function executeCheck($operator, $value) { |
|
62 | + public function executeCheck($operator, $value) { |
|
63 | 63 | $actualValue = $this->getActualValue(); |
64 | 64 | return $this->executeStringCheck($operator, $value, $actualValue); |
65 | 65 | } |
@@ -109,8 +109,8 @@ |
||
109 | 109 | throw new \UnexpectedValueException($this->l->t('The given operator is invalid'), 1); |
110 | 110 | } |
111 | 111 | |
112 | - $regexValue = '\"' . self::REGEX_TIME . ' ' . self::REGEX_TIMEZONE . '\"'; |
|
113 | - $result = preg_match('/^\[' . $regexValue . ',' . $regexValue . '\]$/', $value, $matches); |
|
112 | + $regexValue = '\"'.self::REGEX_TIME.' '.self::REGEX_TIMEZONE.'\"'; |
|
113 | + $result = preg_match('/^\['.$regexValue.','.$regexValue.'\]$/', $value, $matches); |
|
114 | 114 | if (!$result) { |
115 | 115 | throw new \UnexpectedValueException($this->l->t('The given time span is invalid'), 2); |
116 | 116 | } |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | * @param string $value |
48 | 48 | * @return bool |
49 | 49 | */ |
50 | - public function executeCheck($operator, $value) { |
|
50 | + public function executeCheck($operator, $value) { |
|
51 | 51 | $actualValue = $this->getActualValue(); |
52 | 52 | if (in_array($operator, ['is', '!is'])) { |
53 | 53 | switch ($value) { |
@@ -70,10 +70,10 @@ discard block |
||
70 | 70 | return $this->url; |
71 | 71 | } |
72 | 72 | |
73 | - $this->url = $this->request->getServerProtocol() . '://';// E.g. http(s) + :// |
|
74 | - $this->url .= $this->request->getServerHost();// E.g. localhost |
|
75 | - $this->url .= $this->request->getScriptName();// E.g. /nextcloud/index.php |
|
76 | - $this->url .= $this->request->getPathInfo();// E.g. /apps/files_texteditor/ajax/loadfile |
|
73 | + $this->url = $this->request->getServerProtocol().'://'; // E.g. http(s) + :// |
|
74 | + $this->url .= $this->request->getServerHost(); // E.g. localhost |
|
75 | + $this->url .= $this->request->getScriptName(); // E.g. /nextcloud/index.php |
|
76 | + $this->url .= $this->request->getPathInfo(); // E.g. /apps/files_texteditor/ajax/loadfile |
|
77 | 77 | |
78 | 78 | return $this->url; // E.g. https://localhost/nextcloud/index.php/apps/files_texteditor/ajax/loadfile |
79 | 79 | } |
@@ -323,7 +323,7 @@ |
||
323 | 323 | * @return int Check unique ID |
324 | 324 | */ |
325 | 325 | protected function addCheck($class, $operator, $value) { |
326 | - $hash = md5($class . '::' . $operator . '::' . $value); |
|
326 | + $hash = md5($class.'::'.$operator.'::'.$value); |
|
327 | 327 | |
328 | 328 | $query = $this->connection->getQueryBuilder(); |
329 | 329 | $query->select('id') |
@@ -48,7 +48,7 @@ |
||
48 | 48 | if ($uid !== 'admin') { |
49 | 49 | $uid = md5($uid); |
50 | 50 | } |
51 | - return \OC::$server->getConfig()->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data') . '/' . $uid; |
|
51 | + return \OC::$server->getConfig()->getSystemValue('datadirectory', \OC::$SERVERROOT.'/data').'/'.$uid; |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | return false; |