@@ -49,10 +49,10 @@ discard block |
||
49 | 49 | */ |
50 | 50 | interface IDBConnection { |
51 | 51 | |
52 | - const ADD_MISSING_INDEXES_EVENT = self::class . '::ADD_MISSING_INDEXES'; |
|
53 | - const CHECK_MISSING_INDEXES_EVENT = self::class . '::CHECK_MISSING_INDEXES'; |
|
54 | - const ADD_MISSING_COLUMNS_EVENT = self::class . '::ADD_MISSING_COLUMNS'; |
|
55 | - const CHECK_MISSING_COLUMNS_EVENT = self::class . '::CHECK_MISSING_COLUMNS'; |
|
52 | + const ADD_MISSING_INDEXES_EVENT = self::class.'::ADD_MISSING_INDEXES'; |
|
53 | + const CHECK_MISSING_INDEXES_EVENT = self::class.'::CHECK_MISSING_INDEXES'; |
|
54 | + const ADD_MISSING_COLUMNS_EVENT = self::class.'::ADD_MISSING_COLUMNS'; |
|
55 | + const CHECK_MISSING_COLUMNS_EVENT = self::class.'::CHECK_MISSING_COLUMNS'; |
|
56 | 56 | |
57 | 57 | /** |
58 | 58 | * Gets the QueryBuilder for the connection. |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | * @return \Doctrine\DBAL\Driver\Statement The prepared statement. |
71 | 71 | * @since 6.0.0 |
72 | 72 | */ |
73 | - public function prepare($sql, $limit=null, $offset=null); |
|
73 | + public function prepare($sql, $limit = null, $offset = null); |
|
74 | 74 | |
75 | 75 | /** |
76 | 76 | * Executes an, optionally parameterized, SQL query. |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | * @return int number of inserted rows |
138 | 138 | * @since 16.0.0 |
139 | 139 | */ |
140 | - public function insertIgnoreConflict(string $table,array $values) : int; |
|
140 | + public function insertIgnoreConflict(string $table, array $values) : int; |
|
141 | 141 | |
142 | 142 | /** |
143 | 143 | * Insert or update a row value |
@@ -89,14 +89,14 @@ discard block |
||
89 | 89 | * @return array |
90 | 90 | */ |
91 | 91 | protected function normalizeDatabaseData(array $data) { |
92 | - $data['id'] = (string)$data['id']; |
|
93 | - $data['parent_id'] = (string)$data['parent_id']; |
|
94 | - $data['topmost_parent_id'] = (string)$data['topmost_parent_id']; |
|
92 | + $data['id'] = (string) $data['id']; |
|
93 | + $data['parent_id'] = (string) $data['parent_id']; |
|
94 | + $data['topmost_parent_id'] = (string) $data['topmost_parent_id']; |
|
95 | 95 | $data['creation_timestamp'] = new \DateTime($data['creation_timestamp']); |
96 | 96 | if (!is_null($data['latest_child_timestamp'])) { |
97 | 97 | $data['latest_child_timestamp'] = new \DateTime($data['latest_child_timestamp']); |
98 | 98 | } |
99 | - $data['children_count'] = (int)$data['children_count']; |
|
99 | + $data['children_count'] = (int) $data['children_count']; |
|
100 | 100 | $data['reference_id'] = $data['reference_id'] ?? null; |
101 | 101 | return $data; |
102 | 102 | } |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | $resultStatement = $query->execute(); |
184 | 184 | $data = $resultStatement->fetch(\PDO::FETCH_NUM); |
185 | 185 | $resultStatement->closeCursor(); |
186 | - $children = (int)$data[0]; |
|
186 | + $children = (int) $data[0]; |
|
187 | 187 | |
188 | 188 | $comment = $this->get($id); |
189 | 189 | $comment->setChildrenCount($children); |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | !is_string($type) || empty($type) |
206 | 206 | || !is_string($id) || empty($id) |
207 | 207 | ) { |
208 | - throw new \InvalidArgumentException($role . ' parameters must be string and not empty'); |
|
208 | + throw new \InvalidArgumentException($role.' parameters must be string and not empty'); |
|
209 | 209 | } |
210 | 210 | } |
211 | 211 | |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | if (empty($id)) { |
220 | 220 | return; |
221 | 221 | } |
222 | - $this->commentsCache[(string)$id] = $comment; |
|
222 | + $this->commentsCache[(string) $id] = $comment; |
|
223 | 223 | } |
224 | 224 | |
225 | 225 | /** |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | * @param mixed $id the comment's id |
229 | 229 | */ |
230 | 230 | protected function uncache($id) { |
231 | - $id = (string)$id; |
|
231 | + $id = (string) $id; |
|
232 | 232 | if (isset($this->commentsCache[$id])) { |
233 | 233 | unset($this->commentsCache[$id]); |
234 | 234 | } |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | * @since 9.0.0 |
245 | 245 | */ |
246 | 246 | public function get($id) { |
247 | - if ((int)$id === 0) { |
|
247 | + if ((int) $id === 0) { |
|
248 | 248 | throw new \InvalidArgumentException('IDs must be translatable to a number in this implementation.'); |
249 | 249 | } |
250 | 250 | |
@@ -523,7 +523,7 @@ discard block |
||
523 | 523 | $query->select('*') |
524 | 524 | ->from('comments') |
525 | 525 | ->where($query->expr()->iLike('message', $query->createNamedParameter( |
526 | - '%' . $this->dbConn->escapeLikeParameter($search). '%' |
|
526 | + '%'.$this->dbConn->escapeLikeParameter($search).'%' |
|
527 | 527 | ))) |
528 | 528 | ->orderBy('creation_timestamp', 'DESC') |
529 | 529 | ->addOrderBy('id', 'DESC') |
@@ -585,7 +585,7 @@ discard block |
||
585 | 585 | $resultStatement = $query->execute(); |
586 | 586 | $data = $resultStatement->fetch(\PDO::FETCH_NUM); |
587 | 587 | $resultStatement->closeCursor(); |
588 | - return (int)$data[0]; |
|
588 | + return (int) $data[0]; |
|
589 | 589 | } |
590 | 590 | |
591 | 591 | /** |
@@ -789,7 +789,7 @@ discard block |
||
789 | 789 | ->execute(); |
790 | 790 | |
791 | 791 | if ($affectedRows > 0) { |
792 | - $comment->setId((string)$qb->getLastInsertId()); |
|
792 | + $comment->setId((string) $qb->getLastInsertId()); |
|
793 | 793 | $this->sendEvent(CommentsEvent::EVENT_ADD, $comment); |
794 | 794 | } |
795 | 795 | |
@@ -1084,7 +1084,7 @@ discard block |
||
1084 | 1084 | if (!isset($this->displayNameResolvers[$type])) { |
1085 | 1085 | throw new \OutOfBoundsException('No Displayname resolver for this type registered'); |
1086 | 1086 | } |
1087 | - return (string)$this->displayNameResolvers[$type]($id); |
|
1087 | + return (string) $this->displayNameResolvers[$type]($id); |
|
1088 | 1088 | } |
1089 | 1089 | |
1090 | 1090 | /** |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | |
62 | 62 | $container = $this->getContainer(); |
63 | 63 | |
64 | - $container->registerService('defaultMailAddress', function () { |
|
64 | + $container->registerService('defaultMailAddress', function() { |
|
65 | 65 | return Util::getDefaultEmailAddress('lostpassword-noreply'); |
66 | 66 | }); |
67 | 67 | |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | $notificationManager->registerNotifierService(AuthenticationNotifier::class); |
75 | 75 | |
76 | 76 | $eventDispatcher->addListener(IDBConnection::CHECK_MISSING_INDEXES_EVENT, |
77 | - function (GenericEvent $event) use ($container) { |
|
77 | + function(GenericEvent $event) use ($container) { |
|
78 | 78 | /** @var MissingIndexInformation $subject */ |
79 | 79 | $subject = $event->getSubject(); |
80 | 80 | |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | ); |
170 | 170 | |
171 | 171 | $eventDispatcher->addListener(IDBConnection::CHECK_MISSING_COLUMNS_EVENT, |
172 | - function (GenericEvent $event) use ($container) { |
|
172 | + function(GenericEvent $event) use ($container) { |
|
173 | 173 | /** @var MissingColumnInformation $subject */ |
174 | 174 | $subject = $event->getSubject(); |
175 | 175 |