@@ -94,14 +94,14 @@ discard block |
||
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 | return $data; |
107 | 107 | } |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | $resultStatement = $query->execute(); |
189 | 189 | $data = $resultStatement->fetch(\PDO::FETCH_NUM); |
190 | 190 | $resultStatement->closeCursor(); |
191 | - $children = (int)$data[0]; |
|
191 | + $children = (int) $data[0]; |
|
192 | 192 | |
193 | 193 | $comment = $this->get($id); |
194 | 194 | $comment->setChildrenCount($children); |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | !is_string($type) || empty($type) |
211 | 211 | || !is_string($id) || empty($id) |
212 | 212 | ) { |
213 | - throw new \InvalidArgumentException($role . ' parameters must be string and not empty'); |
|
213 | + throw new \InvalidArgumentException($role.' parameters must be string and not empty'); |
|
214 | 214 | } |
215 | 215 | } |
216 | 216 | |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | if (empty($id)) { |
225 | 225 | return; |
226 | 226 | } |
227 | - $this->commentsCache[(string)$id] = $comment; |
|
227 | + $this->commentsCache[(string) $id] = $comment; |
|
228 | 228 | } |
229 | 229 | |
230 | 230 | /** |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | * @param mixed $id the comment's id |
234 | 234 | */ |
235 | 235 | protected function uncache($id) { |
236 | - $id = (string)$id; |
|
236 | + $id = (string) $id; |
|
237 | 237 | if (isset($this->commentsCache[$id])) { |
238 | 238 | unset($this->commentsCache[$id]); |
239 | 239 | } |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | * @since 9.0.0 |
250 | 250 | */ |
251 | 251 | public function get($id) { |
252 | - if ((int)$id === 0) { |
|
252 | + if ((int) $id === 0) { |
|
253 | 253 | throw new \InvalidArgumentException('IDs must be translatable to a number in this implementation.'); |
254 | 254 | } |
255 | 255 | |
@@ -559,7 +559,7 @@ discard block |
||
559 | 559 | $query->select('*') |
560 | 560 | ->from('comments') |
561 | 561 | ->where($query->expr()->iLike('message', $query->createNamedParameter( |
562 | - '%' . $this->dbConn->escapeLikeParameter($search). '%' |
|
562 | + '%'.$this->dbConn->escapeLikeParameter($search).'%' |
|
563 | 563 | ))) |
564 | 564 | ->orderBy('creation_timestamp', 'DESC') |
565 | 565 | ->addOrderBy('id', 'DESC') |
@@ -621,7 +621,7 @@ discard block |
||
621 | 621 | $resultStatement = $query->execute(); |
622 | 622 | $data = $resultStatement->fetch(\PDO::FETCH_NUM); |
623 | 623 | $resultStatement->closeCursor(); |
624 | - return (int)$data[0]; |
|
624 | + return (int) $data[0]; |
|
625 | 625 | } |
626 | 626 | |
627 | 627 | /** |
@@ -700,7 +700,7 @@ discard block |
||
700 | 700 | |
701 | 701 | $query = $this->dbConn->getQueryBuilder(); |
702 | 702 | $query->select('actor_id') |
703 | - ->selectAlias($query->createFunction('MAX(' . $query->getColumnName('creation_timestamp') . ')'), 'last_comment') |
|
703 | + ->selectAlias($query->createFunction('MAX('.$query->getColumnName('creation_timestamp').')'), 'last_comment') |
|
704 | 704 | ->from('comments') |
705 | 705 | ->where($query->expr()->eq('object_type', $query->createNamedParameter($objectType))) |
706 | 706 | ->andWhere($query->expr()->eq('object_id', $query->createNamedParameter($objectId))) |
@@ -919,7 +919,7 @@ discard block |
||
919 | 919 | ->execute(); |
920 | 920 | |
921 | 921 | if ($affectedRows > 0) { |
922 | - $comment->setId((string)$qb->getLastInsertId()); |
|
922 | + $comment->setId((string) $qb->getLastInsertId()); |
|
923 | 923 | $this->sendEvent(CommentsEvent::EVENT_ADD, $comment); |
924 | 924 | } |
925 | 925 | |
@@ -1219,7 +1219,7 @@ discard block |
||
1219 | 1219 | if (!isset($this->displayNameResolvers[$type])) { |
1220 | 1220 | throw new \OutOfBoundsException('No Displayname resolver for this type registered'); |
1221 | 1221 | } |
1222 | - return (string)$this->displayNameResolvers[$type]($id); |
|
1222 | + return (string) $this->displayNameResolvers[$type]($id); |
|
1223 | 1223 | } |
1224 | 1224 | |
1225 | 1225 | /** |