Passed
Push — master ( b0fbcc...642f07 )
by Joas
14:16 queued 13s
created
lib/private/Comments/Manager.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -94,21 +94,21 @@  discard block
 block discarded – undo
94 94
 	 * @return array
95 95
 	 */
96 96
 	protected function normalizeDatabaseData(array $data) {
97
-		$data['id'] = (string)$data['id'];
98
-		$data['parent_id'] = (string)$data['parent_id'];
99
-		$data['topmost_parent_id'] = (string)$data['topmost_parent_id'];
97
+		$data['id'] = (string) $data['id'];
98
+		$data['parent_id'] = (string) $data['parent_id'];
99
+		$data['topmost_parent_id'] = (string) $data['topmost_parent_id'];
100 100
 		$data['creation_timestamp'] = new \DateTime($data['creation_timestamp']);
101 101
 		if (!is_null($data['latest_child_timestamp'])) {
102 102
 			$data['latest_child_timestamp'] = new \DateTime($data['latest_child_timestamp']);
103 103
 		}
104
-		$data['children_count'] = (int)$data['children_count'];
104
+		$data['children_count'] = (int) $data['children_count'];
105 105
 		$data['reference_id'] = $data['reference_id'] ?? null;
106 106
 		if ($this->supportReactions()) {
107 107
 			$list = json_decode($data['reactions'], true);
108 108
 			// Ordering does not work on the database with group concat and Oracle,
109 109
 			// So we simply sort on the output.
110 110
 			if (is_array($list)) {
111
-				uasort($list, static function ($a, $b) {
111
+				uasort($list, static function($a, $b) {
112 112
 					if ($a === $b) {
113 113
 						return 0;
114 114
 					}
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
 		$resultStatement = $query->execute();
207 207
 		$data = $resultStatement->fetch(\PDO::FETCH_NUM);
208 208
 		$resultStatement->closeCursor();
209
-		$children = (int)$data[0];
209
+		$children = (int) $data[0];
210 210
 
211 211
 		$comment = $this->get($id);
212 212
 		$comment->setChildrenCount($children);
@@ -228,7 +228,7 @@  discard block
 block discarded – undo
228 228
 			!is_string($type) || empty($type)
229 229
 			|| !is_string($id) || empty($id)
230 230
 		) {
231
-			throw new \InvalidArgumentException($role . ' parameters must be string and not empty');
231
+			throw new \InvalidArgumentException($role.' parameters must be string and not empty');
232 232
 		}
233 233
 	}
234 234
 
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
 		if (empty($id)) {
243 243
 			return;
244 244
 		}
245
-		$this->commentsCache[(string)$id] = $comment;
245
+		$this->commentsCache[(string) $id] = $comment;
246 246
 	}
247 247
 
248 248
 	/**
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
 	 * @param mixed $id the comment's id
252 252
 	 */
253 253
 	protected function uncache($id) {
254
-		$id = (string)$id;
254
+		$id = (string) $id;
255 255
 		if (isset($this->commentsCache[$id])) {
256 256
 			unset($this->commentsCache[$id]);
257 257
 		}
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
 	 * @since 9.0.0
268 268
 	 */
269 269
 	public function get($id) {
270
-		if ((int)$id === 0) {
270
+		if ((int) $id === 0) {
271 271
 			throw new \InvalidArgumentException('IDs must be translatable to a number in this implementation.');
272 272
 		}
273 273
 
@@ -617,7 +617,7 @@  discard block
 block discarded – undo
617 617
 
618 618
 		if ($search !== '') {
619 619
 			$query->where($query->expr()->iLike('message', $query->createNamedParameter(
620
-				'%' . $this->dbConn->escapeLikeParameter($search). '%'
620
+				'%'.$this->dbConn->escapeLikeParameter($search).'%'
621 621
 			)));
622 622
 		}
623 623
 
@@ -677,7 +677,7 @@  discard block
 block discarded – undo
677 677
 		$resultStatement = $query->execute();
678 678
 		$data = $resultStatement->fetch(\PDO::FETCH_NUM);
679 679
 		$resultStatement->closeCursor();
680
-		return (int)$data[0];
680
+		return (int) $data[0];
681 681
 	}
682 682
 
683 683
 	/**
@@ -817,7 +817,7 @@  discard block
 block discarded – undo
817 817
 
818 818
 		$query = $this->dbConn->getQueryBuilder();
819 819
 		$query->select('actor_id')
820
-			->selectAlias($query->createFunction('MAX(' . $query->getColumnName('creation_timestamp') . ')'), 'last_comment')
820
+			->selectAlias($query->createFunction('MAX('.$query->getColumnName('creation_timestamp').')'), 'last_comment')
821 821
 			->from('comments')
822 822
 			->where($query->expr()->eq('object_type', $query->createNamedParameter($objectType)))
823 823
 			->andWhere($query->expr()->eq('object_id', $query->createNamedParameter($objectId)))
@@ -1201,7 +1201,7 @@  discard block
 block discarded – undo
1201 1201
 			->execute();
1202 1202
 
1203 1203
 		if ($affectedRows > 0) {
1204
-			$comment->setId((string)$qb->getLastInsertId());
1204
+			$comment->setId((string) $qb->getLastInsertId());
1205 1205
 			if ($comment->getVerb() === 'reaction') {
1206 1206
 				$this->addReaction($comment);
1207 1207
 			}
@@ -1275,11 +1275,11 @@  discard block
 block discarded – undo
1275 1275
 				),
1276 1276
 				'json'
1277 1277
 			)
1278
-			->from($jsonQuery->createFunction('(' . $totalQuery->getSQL() . ')'), 'json');
1278
+			->from($jsonQuery->createFunction('('.$totalQuery->getSQL().')'), 'json');
1279 1279
 
1280 1280
 		$qb
1281 1281
 			->update('comments')
1282
-			->set('reactions', $jsonQuery->createFunction('(' . $jsonQuery->getSQL() . ')'))
1282
+			->set('reactions', $jsonQuery->createFunction('('.$jsonQuery->getSQL().')'))
1283 1283
 			->where($qb->expr()->eq('id', $qb->createNamedParameter($parentId)))
1284 1284
 			->executeStatement();
1285 1285
 	}
@@ -1581,7 +1581,7 @@  discard block
 block discarded – undo
1581 1581
 		if (!isset($this->displayNameResolvers[$type])) {
1582 1582
 			throw new \OutOfBoundsException('No Displayname resolver for this type registered');
1583 1583
 		}
1584
-		return (string)$this->displayNameResolvers[$type]($id);
1584
+		return (string) $this->displayNameResolvers[$type]($id);
1585 1585
 	}
1586 1586
 
1587 1587
 	/**
Please login to merge, or discard this patch.