Skip to content

Commit 0b63d0e

Browse files
committed
chore(cs): Apply autofixes
Signed-off-by: Joas Schilling <coding@schilljs.com>
1 parent c230297 commit 0b63d0e

19 files changed

Lines changed: 44 additions & 44 deletions

lib/App.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public function markProcessed(INotification $notification): void {
6969
}
7070
foreach ($deleted as $user => $notifications) {
7171
foreach ($notifications as $data) {
72-
$this->push->pushDeleteToDevice((string) $user, [$data['id']], $data['app']);
72+
$this->push->pushDeleteToDevice((string)$user, [$data['id']], $data['app']);
7373
}
7474
}
7575
if (!$isAlreadyDeferring) {

lib/BackgroundJob/GenerateUserSettings.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ protected function run($argument): void {
4949
->setMaxResults(1);
5050

5151
$result = $query->executeQuery();
52-
$maxId = (int) $result->fetchOne();
52+
$maxId = (int)$result->fetchOne();
5353
$result->closeCursor();
5454

5555
$this->userManager->callForSeenUsers(function (IUser $user) use ($maxId) {

lib/Command/Generate.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
9999

100100
$subjectTitle = 'cli';
101101
} else {
102-
$subject = (int) $subject;
102+
$subject = (int)$subject;
103103
$subjectTitle = 'dummy';
104104
}
105105

lib/Controller/APIController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,6 @@ public function generateNotificationV3(
150150
return new DataResponse(['error' => $e->getMessage()], Http::STATUS_BAD_REQUEST);
151151
}
152152

153-
return new DataResponse(['id' => (int) $this->notificationApp->getLastInsertedId()]);
153+
return new DataResponse(['id' => (int)$this->notificationApp->getLastInsertedId()]);
154154
}
155155
}

lib/Controller/EndpointController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ public function confirmIdsForUser(string $apiVersion, array $ids): DataResponse
196196
}
197197

198198
$ids = array_unique(array_filter(array_map(
199-
static fn ($id) => is_numeric($id) ? (int) $id : 0,
199+
static fn ($id) => is_numeric($id) ? (int)$id : 0,
200200
$ids
201201
)));
202202

@@ -333,6 +333,6 @@ protected function getCurrentUser(): string {
333333
$user = $user->getUID();
334334
}
335335

336-
return (string) $user;
336+
return (string)$user;
337337
}
338338
}

lib/Controller/SettingsController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function personal(int $batchSetting, string $soundNotification, string $s
6363
*/
6464
#[OpenAPI(scope: OpenAPI::SCOPE_ADMINISTRATION)]
6565
public function admin(int $batchSetting, string $soundNotification, string $soundTalk): DataResponse {
66-
$this->config->setAppValue(Application::APP_ID, 'setting_batchtime', (string) $batchSetting);
66+
$this->config->setAppValue(Application::APP_ID, 'setting_batchtime', (string)$batchSetting);
6767
$this->config->setAppValue(Application::APP_ID, 'sound_notification', $soundNotification !== 'no' ? 'yes' : 'no');
6868
$this->config->setAppValue(Application::APP_ID, 'sound_talk', $soundTalk !== 'no' ? 'yes' : 'no');
6969

lib/Handler.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function count(INotification $notification): int {
5959
$this->sqlWhere($sql, $notification);
6060

6161
$statement = $sql->executeQuery();
62-
$count = (int) $statement->fetchOne();
62+
$count = (int)$statement->fetchOne();
6363
$statement->closeCursor();
6464

6565
return $count;
@@ -87,10 +87,10 @@ public function delete(INotification $notification): array {
8787
}
8888

8989
$deleted[$row['user']][] = [
90-
'id' => (int) $row['notification_id'],
90+
'id' => (int)$row['notification_id'],
9191
'app' => $row['app'],
9292
];
93-
$notifications[(int) $row['notification_id']] = $this->notificationFromRow($row);
93+
$notifications[(int)$row['notification_id']] = $this->notificationFromRow($row);
9494
}
9595
$statement->closeCursor();
9696

@@ -159,7 +159,7 @@ public function deleteById(int $id, string $user, ?INotification $notification =
159159
$sql->delete('notifications')
160160
->where($sql->expr()->eq('notification_id', $sql->createNamedParameter($id)))
161161
->andWhere($sql->expr()->eq('user', $sql->createNamedParameter($user)));
162-
return (bool) $sql->executeStatement();
162+
return (bool)$sql->executeStatement();
163163
}
164164

165165
/**
@@ -220,7 +220,7 @@ public function confirmIdsForUser(string $user, array $ids): array {
220220

221221
$existing = [];
222222
while ($row = $result->fetch()) {
223-
$existing[] = (int) $row['notification_id'];
223+
$existing[] = (int)$row['notification_id'];
224224
}
225225
$result->closeCursor();
226226

@@ -366,17 +366,17 @@ protected function sqlInsert(IQueryBuilder $sql, INotification $notification) {
366366
*/
367367
protected function notificationFromRow(array $row): INotification {
368368
$dateTime = new \DateTime();
369-
$dateTime->setTimestamp((int) $row['timestamp']);
369+
$dateTime->setTimestamp((int)$row['timestamp']);
370370

371371
$notification = $this->manager->createNotification();
372372
$notification->setApp($row['app'])
373373
->setUser($row['user'])
374374
->setDateTime($dateTime)
375375
->setObject($row['object_type'], $row['object_id'])
376-
->setSubject($row['subject'], (array) json_decode($row['subject_parameters'], true));
376+
->setSubject($row['subject'], (array)json_decode($row['subject_parameters'], true));
377377

378378
if ($row['message'] !== '' && $row['message'] !== null) {
379-
$notification->setMessage($row['message'], (array) json_decode($row['message_parameters'], true));
379+
$notification->setMessage($row['message'], (array)json_decode($row['message_parameters'], true));
380380
}
381381
if ($row['link'] !== '' && $row['link'] !== null) {
382382
$notification->setLink($row['link']);
@@ -385,7 +385,7 @@ protected function notificationFromRow(array $row): INotification {
385385
$notification->setIcon($row['icon']);
386386
}
387387

388-
$actions = (array) json_decode($row['actions'], true);
388+
$actions = (array)json_decode($row['actions'], true);
389389
foreach ($actions as $actionData) {
390390
$action = $notification->createAction();
391391
$action->setLabel($actionData['label'])

lib/Listener/PostLoginListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function handle(Event $event): void {
4343
} catch (DoesNotExistException $e) {
4444
$defaultSoundNotification = $this->config->getAppValue(Application::APP_ID, 'sound_notification') === 'yes' ? 'yes' : 'no';
4545
$defaultSoundTalk = $this->config->getAppValue(Application::APP_ID, 'sound_talk') === 'yes' ? 'yes' : 'no';
46-
$defaultBatchtime = (int) $this->config->getAppValue(Application::APP_ID, 'setting_batchtime');
46+
$defaultBatchtime = (int)$this->config->getAppValue(Application::APP_ID, 'setting_batchtime');
4747

4848
if ($defaultBatchtime !== Settings::EMAIL_SEND_WEEKLY
4949
&& $defaultBatchtime !== Settings::EMAIL_SEND_DAILY

lib/Listener/UserCreatedListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function handle(Event $event): void {
3939

4040
$defaultSoundNotification = $this->config->getAppValue(Application::APP_ID, 'sound_notification') === 'yes' ? 'yes' : 'no';
4141
$defaultSoundTalk = $this->config->getAppValue(Application::APP_ID, 'sound_talk') === 'yes' ? 'yes' : 'no';
42-
$defaultBatchtime = (int) $this->config->getAppValue(Application::APP_ID, 'setting_batchtime');
42+
$defaultBatchtime = (int)$this->config->getAppValue(Application::APP_ID, 'setting_batchtime');
4343

4444
if ($defaultBatchtime !== Settings::EMAIL_SEND_WEEKLY
4545
&& $defaultBatchtime !== Settings::EMAIL_SEND_DAILY

lib/Migration/Version2010Date20210218082811.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public function postSchemaChange(IOutput $output, Closure $schemaClosure, array
117117
while ($row = $result->fetch()) {
118118
$insert
119119
->setParameter('uid', $row['uid'])
120-
->setParameter('token', (int) $row['token'], IQueryBuilder::PARAM_INT)
120+
->setParameter('token', (int)$row['token'], IQueryBuilder::PARAM_INT)
121121
->setParameter('deviceidentifier', $row['deviceidentifier'])
122122
->setParameter('devicepublickey', $row['devicepublickey'])
123123
->setParameter('devicepublickeyhash', $row['devicepublickeyhash'])

0 commit comments

Comments
 (0)