Skip to content

Commit c06d3f0

Browse files
committed
chore(deps): Update nextcloud/coding-standard to v1.3.0
Signed-off-by: provokateurin <kate@provokateurin.de>
1 parent 33928fc commit c06d3f0

1,886 files changed

Lines changed: 10562 additions & 1740 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

apps/admin_audit/lib/Actions/Action.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,19 @@ public function log(string $text,
3232
if (!isset($params[$element])) {
3333
if ($obfuscateParameters) {
3434
$this->logger->critical(
35-
'$params["'.$element.'"] was missing.',
35+
'$params["' . $element . '"] was missing.',
3636
['app' => 'admin_audit']
3737
);
3838
} else {
3939
$this->logger->critical(
4040
sprintf(
41-
'$params["'.$element.'"] was missing. Transferred value: %s',
41+
'$params["' . $element . '"] was missing. Transferred value: %s',
4242
print_r($params, true)
4343
),
4444
['app' => 'admin_audit']
4545
);
4646
}
47+
4748
return;
4849
}
4950
}
@@ -53,6 +54,7 @@ public function log(string $text,
5354
if ($params[$element] instanceof \DateTime) {
5455
$params[$element] = $params[$element]->format('Y-m-d H:i:s');
5556
}
57+
5658
$replaceArray[] = $params[$element];
5759
}
5860

apps/admin_audit/lib/Actions/Files.php

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,12 @@ public function read(BeforeNodeReadEvent $event): void {
4242
];
4343
} catch (InvalidPathException|NotFoundException $e) {
4444
\OCP\Server::get(LoggerInterface::class)->error(
45-
'Exception thrown in file read: '.$e->getMessage(), ['app' => 'admin_audit', 'exception' => $e]
45+
'Exception thrown in file read: ' . $e->getMessage(), ['app' => 'admin_audit', 'exception' => $e]
4646
);
47+
4748
return;
4849
}
50+
4951
$this->log(
5052
'File with id "%s" accessed: "%s"',
5153
$params,
@@ -64,8 +66,9 @@ public function beforeRename(BeforeNodeRenamedEvent $event): void {
6466
$this->renamedNodes[$source->getId()] = $source;
6567
} catch (InvalidPathException|NotFoundException $e) {
6668
\OCP\Server::get(LoggerInterface::class)->error(
67-
'Exception thrown in file rename: '.$e->getMessage(), ['app' => 'admin_audit', 'exception' => $e]
69+
'Exception thrown in file rename: ' . $e->getMessage(), ['app' => 'admin_audit', 'exception' => $e]
6870
);
71+
6972
return;
7073
}
7174
}
@@ -86,8 +89,9 @@ public function afterRename(NodeRenamedEvent $event): void {
8689
];
8790
} catch (InvalidPathException|NotFoundException $e) {
8891
\OCP\Server::get(LoggerInterface::class)->error(
89-
'Exception thrown in file rename: '.$e->getMessage(), ['app' => 'admin_audit', 'exception' => $e]
92+
'Exception thrown in file rename: ' . $e->getMessage(), ['app' => 'admin_audit', 'exception' => $e]
9093
);
94+
9195
return;
9296
}
9397

@@ -112,13 +116,16 @@ public function create(NodeCreatedEvent $event): void {
112116
];
113117
} catch (InvalidPathException|NotFoundException $e) {
114118
\OCP\Server::get(LoggerInterface::class)->error(
115-
'Exception thrown in file create: '.$e->getMessage(), ['app' => 'admin_audit', 'exception' => $e]
119+
'Exception thrown in file create: ' . $e->getMessage(), ['app' => 'admin_audit', 'exception' => $e]
116120
);
121+
117122
return;
118123
}
124+
119125
if ($params['path'] === '/' || $params['path'] === '') {
120126
return;
121127
}
128+
122129
$this->log(
123130
'File with id "%s" created: "%s"',
124131
$params,
@@ -141,10 +148,12 @@ public function copy(NodeCopiedEvent $event): void {
141148
];
142149
} catch (InvalidPathException|NotFoundException $e) {
143150
\OCP\Server::get(LoggerInterface::class)->error(
144-
'Exception thrown in file copy: '.$e->getMessage(), ['app' => 'admin_audit', 'exception' => $e]
151+
'Exception thrown in file copy: ' . $e->getMessage(), ['app' => 'admin_audit', 'exception' => $e]
145152
);
153+
146154
return;
147155
}
156+
148157
$this->log(
149158
'File id copied from: "%s" to "%s", path from "%s" to "%s"',
150159
$params,
@@ -166,10 +175,12 @@ public function write(BeforeNodeWrittenEvent $event): void {
166175
];
167176
} catch (InvalidPathException|NotFoundException $e) {
168177
\OCP\Server::get(LoggerInterface::class)->error(
169-
'Exception thrown in file write: '.$e->getMessage(), ['app' => 'admin_audit', 'exception' => $e]
178+
'Exception thrown in file write: ' . $e->getMessage(), ['app' => 'admin_audit', 'exception' => $e]
170179
);
180+
171181
return;
172182
}
183+
173184
if ($params['path'] === '/' || $params['path'] === '') {
174185
return;
175186
}
@@ -194,10 +205,12 @@ public function update(NodeWrittenEvent $event): void {
194205
];
195206
} catch (InvalidPathException|NotFoundException $e) {
196207
\OCP\Server::get(LoggerInterface::class)->error(
197-
'Exception thrown in file update: '.$e->getMessage(), ['app' => 'admin_audit', 'exception' => $e]
208+
'Exception thrown in file update: ' . $e->getMessage(), ['app' => 'admin_audit', 'exception' => $e]
198209
);
210+
199211
return;
200212
}
213+
201214
$this->log(
202215
'File with id "%s" updated: "%s"',
203216
$params,
@@ -218,10 +231,12 @@ public function delete(NodeDeletedEvent $event): void {
218231
];
219232
} catch (InvalidPathException|NotFoundException $e) {
220233
\OCP\Server::get(LoggerInterface::class)->error(
221-
'Exception thrown in file delete: '.$e->getMessage(), ['app' => 'admin_audit', 'exception' => $e]
234+
'Exception thrown in file delete: ' . $e->getMessage(), ['app' => 'admin_audit', 'exception' => $e]
222235
);
236+
223237
return;
224238
}
239+
225240
$this->log(
226241
'File with id "%s" deleted: "%s"',
227242
$params,

apps/admin_audit/lib/Listener/FileEventListener.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,9 @@ private function beforePreviewFetched(BeforePreviewFetchedEvent $event): void {
4848
);
4949
} catch (InvalidPathException|NotFoundException $e) {
5050
\OCP\Server::get(LoggerInterface::class)->error(
51-
'Exception thrown in file preview: '.$e->getMessage(), ['app' => 'admin_audit', 'exception' => $e]
51+
'Exception thrown in file preview: ' . $e->getMessage(), ['app' => 'admin_audit', 'exception' => $e]
5252
);
53+
5354
return;
5455
}
5556
}

apps/cloud_federation_api/lib/Controller/RequestHandlerController.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function __construct(
5050
private ICloudFederationProviderManager $cloudFederationProviderManager,
5151
private Config $config,
5252
private ICloudFederationFactory $factory,
53-
private ICloudIdManager $cloudIdManager
53+
private ICloudIdManager $cloudIdManager,
5454
) {
5555
parent::__construct($appName, $request);
5656
}
@@ -125,6 +125,7 @@ public function addShare($shareWith, $name, $description, $providerId, $owner, $
125125
Http::STATUS_BAD_REQUEST
126126
);
127127
$response->throttle();
128+
128129
return $response;
129130
}
130131
}
@@ -139,6 +140,7 @@ public function addShare($shareWith, $name, $description, $providerId, $owner, $
139140
Http::STATUS_BAD_REQUEST
140141
);
141142
$response->throttle();
143+
142144
return $response;
143145
}
144146
}
@@ -242,6 +244,7 @@ public function receiveNotification($notificationType, $resourceType, $providerI
242244
Http::STATUS_BAD_REQUEST
243245
);
244246
$response->throttle();
247+
245248
return $response;
246249
} catch (ActionNotSupportedException $e) {
247250
return new JSONResponse(
@@ -253,6 +256,7 @@ public function receiveNotification($notificationType, $resourceType, $providerI
253256
} catch (AuthenticationFailedException $e) {
254257
$response = new JSONResponse(['message' => 'RESOURCE_NOT_FOUND'], Http::STATUS_FORBIDDEN);
255258
$response->throttle();
259+
256260
return $response;
257261
} catch (\Exception $e) {
258262
return new JSONResponse(

apps/comments/lib/Activity/Provider.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ public function parse($language, IEvent $event, ?IEvent $previousEvent = null):
6161

6262
return $this->parseLongVersion($event);
6363
}
64+
6465
throw new UnknownActivityException();
6566

6667
}

apps/comments/lib/Collaboration/CommentersSorter.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ public function sort(array &$sortArray, array $context): void {
4848
if ($r === 0) {
4949
$r = $a[0] - $b[0];
5050
}
51+
5152
return $r;
5253
});
5354

@@ -70,12 +71,14 @@ protected function retrieveCommentsInformation(string $type, string $id): array
7071
if (!isset($actors[$comment->getActorType()])) {
7172
$actors[$comment->getActorType()] = [];
7273
}
74+
7375
if (!isset($actors[$comment->getActorType()][$comment->getActorId()])) {
7476
$actors[$comment->getActorType()][$comment->getActorId()] = 1;
7577
} else {
7678
$actors[$comment->getActorType()][$comment->getActorId()]++;
7779
}
7880
}
81+
7982
return $actors;
8083
}
8184

apps/comments/lib/Controller/NotificationsController.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function __construct(
3333
protected IRootFolder $rootFolder,
3434
protected IURLGenerator $urlGenerator,
3535
protected IManager $notificationManager,
36-
protected IUserSession $userSession
36+
protected IUserSession $userSession,
3737
) {
3838
parent::__construct($appName, $request);
3939
}
@@ -68,6 +68,7 @@ public function view(string $id): RedirectResponse|NotFoundResponse {
6868
if ($comment->getObjectType() !== 'files') {
6969
return new NotFoundResponse();
7070
}
71+
7172
$userFolder = $this->rootFolder->getUserFolder($currentUser->getUID());
7273
$files = $userFolder->getById((int)$comment->getObjectId());
7374

apps/comments/lib/Listener/CommentsEventListener.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ public function handle(Event $event): void {
3939
) {
4040
$this->notificationHandler($event);
4141
$this->activityHandler($event);
42+
4243
return;
4344
}
4445

apps/comments/lib/Notification/Listener.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
class Listener {
1717
public function __construct(
1818
protected IManager $notificationManager,
19-
protected IUserManager $userManager
19+
protected IUserManager $userManager,
2020
) {
2121
}
2222

@@ -73,12 +73,14 @@ public function extractMentions(array $mentions): array {
7373
if (empty($mentions)) {
7474
return [];
7575
}
76+
7677
$uids = [];
7778
foreach ($mentions as $mention) {
7879
if ($mention['type'] === 'user') {
7980
$uids[] = $mention['id'];
8081
}
8182
}
83+
8284
return $uids;
8385
}
8486
}

apps/comments/lib/Notification/Notifier.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public function __construct(
2525
protected IRootFolder $rootFolder,
2626
protected ICommentsManager $commentsManager,
2727
protected IURLGenerator $url,
28-
protected IUserManager $userManager
28+
protected IUserManager $userManager,
2929
) {
3030
}
3131

@@ -61,12 +61,14 @@ public function prepare(INotification $notification, string $languageCode): INot
6161
if ($notification->getApp() !== 'comments') {
6262
throw new UnknownNotificationException();
6363
}
64+
6465
try {
6566
$comment = $this->commentsManager->get($notification->getObjectId());
6667
} catch (NotFoundException $e) {
6768
// needs to be converted to InvalidArgumentException, otherwise none Notifications will be shown at all
6869
throw new UnknownNotificationException('Comment not found', 0, $e);
6970
}
71+
7072
$l = $this->l10nFactory->get('comments', $languageCode);
7173
$displayName = $comment->getActorId();
7274
$isDeletedActor = $comment->getActorType() === ICommentsManager::DELETED_USER;
@@ -83,11 +85,13 @@ public function prepare(INotification $notification, string $languageCode): INot
8385
if ($parameters[0] !== 'files') {
8486
throw new UnknownNotificationException('Unsupported comment object');
8587
}
88+
8689
$userFolder = $this->rootFolder->getUserFolder($notification->getUser());
8790
$nodes = $userFolder->getById((int)$parameters[1]);
8891
if (empty($nodes)) {
8992
throw new AlreadyProcessedException();
9093
}
94+
9195
$node = $nodes[0];
9296

9397
$path = rtrim($node->getPath(), '/');
@@ -96,6 +100,7 @@ public function prepare(INotification $notification, string $languageCode): INot
96100
$fullPath = $path;
97101
[,,, $path] = explode('/', $fullPath, 4);
98102
}
103+
99104
$subjectParameters = [
100105
'file' => [
101106
'type' => 'file',
@@ -116,6 +121,7 @@ public function prepare(INotification $notification, string $languageCode): INot
116121
'name' => $displayName,
117122
];
118123
}
124+
119125
[$message, $messageParameters] = $this->commentToRichMessage($comment);
120126
$notification->setRichSubject($subject, $subjectParameters)
121127
->setRichMessage($message, $messageParameters)
@@ -145,9 +151,11 @@ public function commentToRichMessage(IComment $comment): array {
145151
continue;
146152
}
147153
}
154+
148155
if (!array_key_exists($mention['type'], $mentionTypeCount)) {
149156
$mentionTypeCount[$mention['type']] = 0;
150157
}
158+
151159
$mentionTypeCount[$mention['type']]++;
152160
// To keep a limited character set in parameter IDs ([a-zA-Z0-9-])
153161
// the mention parameter ID does not include the mention ID (which
@@ -166,12 +174,14 @@ public function commentToRichMessage(IComment $comment): array {
166174
// type, so the client decides what to display.
167175
$displayName = '';
168176
}
177+
169178
$messageParameters[$mentionParameterId] = [
170179
'type' => $mention['type'],
171180
'id' => $mention['id'],
172181
'name' => $displayName
173182
];
174183
}
184+
175185
return [$message, $messageParameters];
176186
}
177187
}

0 commit comments

Comments
 (0)