@@ -87,14 +87,14 @@ discard block |
||
87 | 87 | * @return array |
88 | 88 | */ |
89 | 89 | protected function normalizeDatabaseData(array $data) { |
90 | - $data['id'] = (string)$data['id']; |
|
91 | - $data['parent_id'] = (string)$data['parent_id']; |
|
92 | - $data['topmost_parent_id'] = (string)$data['topmost_parent_id']; |
|
90 | + $data['id'] = (string) $data['id']; |
|
91 | + $data['parent_id'] = (string) $data['parent_id']; |
|
92 | + $data['topmost_parent_id'] = (string) $data['topmost_parent_id']; |
|
93 | 93 | $data['creation_timestamp'] = new \DateTime($data['creation_timestamp']); |
94 | 94 | if (!is_null($data['latest_child_timestamp'])) { |
95 | 95 | $data['latest_child_timestamp'] = new \DateTime($data['latest_child_timestamp']); |
96 | 96 | } |
97 | - $data['children_count'] = (int)$data['children_count']; |
|
97 | + $data['children_count'] = (int) $data['children_count']; |
|
98 | 98 | return $data; |
99 | 99 | } |
100 | 100 | |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | $resultStatement = $query->execute(); |
172 | 172 | $data = $resultStatement->fetch(\PDO::FETCH_NUM); |
173 | 173 | $resultStatement->closeCursor(); |
174 | - $children = (int)$data[0]; |
|
174 | + $children = (int) $data[0]; |
|
175 | 175 | |
176 | 176 | $comment = $this->get($id); |
177 | 177 | $comment->setChildrenCount($children); |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | !is_string($type) || empty($type) |
194 | 194 | || !is_string($id) || empty($id) |
195 | 195 | ) { |
196 | - throw new \InvalidArgumentException($role . ' parameters must be string and not empty'); |
|
196 | + throw new \InvalidArgumentException($role.' parameters must be string and not empty'); |
|
197 | 197 | } |
198 | 198 | } |
199 | 199 | |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | if (empty($id)) { |
208 | 208 | return; |
209 | 209 | } |
210 | - $this->commentsCache[(string)$id] = $comment; |
|
210 | + $this->commentsCache[(string) $id] = $comment; |
|
211 | 211 | } |
212 | 212 | |
213 | 213 | /** |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | * @param mixed $id the comment's id |
217 | 217 | */ |
218 | 218 | protected function uncache($id) { |
219 | - $id = (string)$id; |
|
219 | + $id = (string) $id; |
|
220 | 220 | if (isset($this->commentsCache[$id])) { |
221 | 221 | unset($this->commentsCache[$id]); |
222 | 222 | } |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | * @since 9.0.0 |
233 | 233 | */ |
234 | 234 | public function get($id) { |
235 | - if ((int)$id === 0) { |
|
235 | + if ((int) $id === 0) { |
|
236 | 236 | throw new \InvalidArgumentException('IDs must be translatable to a number in this implementation.'); |
237 | 237 | } |
238 | 238 | |
@@ -510,7 +510,7 @@ discard block |
||
510 | 510 | $query->select('*') |
511 | 511 | ->from('comments') |
512 | 512 | ->where($query->expr()->iLike('message', $query->createNamedParameter( |
513 | - '%' . $this->dbConn->escapeLikeParameter($search). '%' |
|
513 | + '%'.$this->dbConn->escapeLikeParameter($search).'%' |
|
514 | 514 | ))) |
515 | 515 | ->orderBy('creation_timestamp', 'DESC') |
516 | 516 | ->addOrderBy('id', 'DESC') |
@@ -552,7 +552,7 @@ discard block |
||
552 | 552 | */ |
553 | 553 | public function getNumberOfCommentsForObject($objectType, $objectId, \DateTime $notOlderThan = null, $verb = '') { |
554 | 554 | $qb = $this->dbConn->getQueryBuilder(); |
555 | - $query = $qb->select($qb->createFunction('COUNT(' . $qb->getColumnName('id') . ')')) |
|
555 | + $query = $qb->select($qb->createFunction('COUNT('.$qb->getColumnName('id').')')) |
|
556 | 556 | ->from('comments') |
557 | 557 | ->where($qb->expr()->eq('object_type', $qb->createParameter('type'))) |
558 | 558 | ->andWhere($qb->expr()->eq('object_id', $qb->createParameter('id'))) |
@@ -572,7 +572,7 @@ discard block |
||
572 | 572 | $resultStatement = $query->execute(); |
573 | 573 | $data = $resultStatement->fetch(\PDO::FETCH_NUM); |
574 | 574 | $resultStatement->closeCursor(); |
575 | - return (int)$data[0]; |
|
575 | + return (int) $data[0]; |
|
576 | 576 | } |
577 | 577 | |
578 | 578 | /** |
@@ -586,7 +586,7 @@ discard block |
||
586 | 586 | $qb = $this->dbConn->getQueryBuilder(); |
587 | 587 | $query = $qb->select('f.fileid') |
588 | 588 | ->selectAlias( |
589 | - $qb->createFunction('COUNT(' . $qb->getColumnName('c.id') . ')'), |
|
589 | + $qb->createFunction('COUNT('.$qb->getColumnName('c.id').')'), |
|
590 | 590 | 'num_ids' |
591 | 591 | ) |
592 | 592 | ->from('comments', 'c') |
@@ -739,7 +739,7 @@ discard block |
||
739 | 739 | ->execute(); |
740 | 740 | |
741 | 741 | if ($affectedRows > 0) { |
742 | - $comment->setId((string)$qb->getLastInsertId()); |
|
742 | + $comment->setId((string) $qb->getLastInsertId()); |
|
743 | 743 | $this->sendEvent(CommentsEvent::EVENT_ADD, $comment); |
744 | 744 | } |
745 | 745 | |
@@ -1019,7 +1019,7 @@ discard block |
||
1019 | 1019 | if (!isset($this->displayNameResolvers[$type])) { |
1020 | 1020 | throw new \OutOfBoundsException('No Displayname resolver for this type registered'); |
1021 | 1021 | } |
1022 | - return (string)$this->displayNameResolvers[$type]($id); |
|
1022 | + return (string) $this->displayNameResolvers[$type]($id); |
|
1023 | 1023 | } |
1024 | 1024 | |
1025 | 1025 | /** |