Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@

# SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: AGPL-3.0-or-later

# Update to coding-standard 1.2.2
98d8ae805eb6ff38e60237ad4b599605df981322
16 changes: 8 additions & 8 deletions apps/admin_audit/lib/Actions/Files.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function read(BeforeNodeReadEvent $event): void {
];
} catch (InvalidPathException|NotFoundException $e) {
\OCP\Server::get(LoggerInterface::class)->error(
"Exception thrown in file read: ".$e->getMessage(), ['app' => 'admin_audit', 'exception' => $e]
'Exception thrown in file read: '.$e->getMessage(), ['app' => 'admin_audit', 'exception' => $e]
);
return;
}
Expand All @@ -61,7 +61,7 @@ public function beforeRename(BeforeNodeRenamedEvent $event): void {
$this->renamedNodes[$source->getId()] = $source;
} catch (InvalidPathException|NotFoundException $e) {
\OCP\Server::get(LoggerInterface::class)->error(
"Exception thrown in file rename: ".$e->getMessage(), ['app' => 'admin_audit', 'exception' => $e]
'Exception thrown in file rename: '.$e->getMessage(), ['app' => 'admin_audit', 'exception' => $e]
);
return;
}
Expand All @@ -81,7 +81,7 @@ public function afterRename(NodeRenamedEvent $event): void {
];
} catch (InvalidPathException|NotFoundException $e) {
\OCP\Server::get(LoggerInterface::class)->error(
"Exception thrown in file rename: ".$e->getMessage(), ['app' => 'admin_audit', 'exception' => $e]
'Exception thrown in file rename: '.$e->getMessage(), ['app' => 'admin_audit', 'exception' => $e]
);
return;
}
Expand All @@ -105,7 +105,7 @@ public function create(NodeCreatedEvent $event): void {
];
} catch (InvalidPathException|NotFoundException $e) {
\OCP\Server::get(LoggerInterface::class)->error(
"Exception thrown in file create: ".$e->getMessage(), ['app' => 'admin_audit', 'exception' => $e]
'Exception thrown in file create: '.$e->getMessage(), ['app' => 'admin_audit', 'exception' => $e]
);
return;
}
Expand All @@ -132,7 +132,7 @@ public function copy(NodeCopiedEvent $event): void {
];
} catch (InvalidPathException|NotFoundException $e) {
\OCP\Server::get(LoggerInterface::class)->error(
"Exception thrown in file copy: ".$e->getMessage(), ['app' => 'admin_audit', 'exception' => $e]
'Exception thrown in file copy: '.$e->getMessage(), ['app' => 'admin_audit', 'exception' => $e]
);
return;
}
Expand All @@ -155,7 +155,7 @@ public function write(NodeWrittenEvent $event): void {
];
} catch (InvalidPathException|NotFoundException $e) {
\OCP\Server::get(LoggerInterface::class)->error(
"Exception thrown in file write: ".$e->getMessage(), ['app' => 'admin_audit', 'exception' => $e]
'Exception thrown in file write: '.$e->getMessage(), ['app' => 'admin_audit', 'exception' => $e]
);
return;
}
Expand All @@ -181,7 +181,7 @@ public function delete(BeforeNodeDeletedEvent $event): void {
];
} catch (InvalidPathException|NotFoundException $e) {
\OCP\Server::get(LoggerInterface::class)->error(
"Exception thrown in file delete: ".$e->getMessage(), ['app' => 'admin_audit', 'exception' => $e]
'Exception thrown in file delete: '.$e->getMessage(), ['app' => 'admin_audit', 'exception' => $e]
);
return;
}
Expand Down Expand Up @@ -210,7 +210,7 @@ public function preview(BeforePreviewFetchedEvent $event): void {
];
} catch (InvalidPathException|NotFoundException $e) {
\OCP\Server::get(LoggerInterface::class)->error(
"Exception thrown in file preview: ".$e->getMessage(), ['app' => 'admin_audit', 'exception' => $e]
'Exception thrown in file preview: '.$e->getMessage(), ['app' => 'admin_audit', 'exception' => $e]
);
return;
}
Expand Down
4 changes: 2 additions & 2 deletions apps/cloud_federation_api/lib/Capabilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ public function getCapabilities() {

$resource = $this->provider->createNewResourceType();
$resource->setName('file')
->setShareTypes(['user', 'group'])
->setProtocols(['webdav' => '/public.php/webdav/']);
->setShareTypes(['user', 'group'])
->setProtocols(['webdav' => '/public.php/webdav/']);

$this->provider->addResourceType($resource);

Expand Down
1 change: 1 addition & 0 deletions apps/cloud_federation_api/lib/Config.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
Expand Down Expand Up @@ -71,9 +72,9 @@ public function __construct(
* @param string $resourceType 'file', 'calendar',...
*
* @return JSONResponse<Http::STATUS_CREATED, CloudFederationAPIAddShare, array{}>|JSONResponse<Http::STATUS_BAD_REQUEST, CloudFederationAPIValidationError, array{}>|JSONResponse<Http::STATUS_NOT_IMPLEMENTED, CloudFederationAPIError, array{}>
* 201: The notification was successfully received. The display name of the recipient might be returned in the body
* 400: Bad request due to invalid parameters, e.g. when `shareWith` is not found or required properties are missing
* 501: Share type or the resource type is not supported
* 201: The notification was successfully received. The display name of the recipient might be returned in the body
* 400: Bad request due to invalid parameters, e.g. when `shareWith` is not found or required properties are missing
* 501: Share type or the resource type is not supported
*/
#[PublicPage]
#[NoCSRFRequired]
Expand Down Expand Up @@ -196,10 +197,10 @@ public function addShare($shareWith, $name, $description, $providerId, $owner, $
* @param array<string, mixed>|null $notification The actual payload of the notification
*
* @return JSONResponse<Http::STATUS_CREATED, array<string, mixed>, array{}>|JSONResponse<Http::STATUS_BAD_REQUEST, CloudFederationAPIValidationError, array{}>|JSONResponse<Http::STATUS_FORBIDDEN|Http::STATUS_NOT_IMPLEMENTED, CloudFederationAPIError, array{}>
* 201: The notification was successfully received
* 400: Bad request due to invalid parameters, e.g. when `type` is invalid or missing
* 403: Getting resource is not allowed
* 501: The resource type is not supported
* 201: The notification was successfully received
* 400: Bad request due to invalid parameters, e.g. when `type` is invalid or missing
* 403: Getting resource is not allowed
* 501: The resource type is not supported
*/
#[NoCSRFRequired]
#[PublicPage]
Expand Down
1 change: 1 addition & 0 deletions apps/comments/lib/Activity/Filter.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
Expand Down
6 changes: 3 additions & 3 deletions apps/comments/lib/Activity/Listener.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function commentEvent(CommentsEvent $event): void {

// Get all mount point owners
$cache = $this->mountCollection->getMountCache();
$mounts = $cache->getMountsForFileId((int)$event->getComment()->getObjectId());
$mounts = $cache->getMountsForFileId((int) $event->getComment()->getObjectId());
if (empty($mounts)) {
return;
}
Expand All @@ -47,7 +47,7 @@ public function commentEvent(CommentsEvent $event): void {
foreach ($mounts as $mount) {
$owner = $mount->getUser()->getUID();
$ownerFolder = $this->rootFolder->getUserFolder($owner);
$nodes = $ownerFolder->getById((int)$event->getComment()->getObjectId());
$nodes = $ownerFolder->getById((int) $event->getComment()->getObjectId());
if (!empty($nodes)) {
/** @var Node $node */
$node = array_shift($nodes);
Expand Down Expand Up @@ -75,7 +75,7 @@ public function commentEvent(CommentsEvent $event): void {
foreach ($users as $user => $path) {
// numerical user ids end up as integers from array keys, but string
// is required
$activity->setAffectedUser((string)$user);
$activity->setAffectedUser((string) $user);

$activity->setSubject('add_comment_subject', [
'actor' => $actor,
Expand Down
1 change: 1 addition & 0 deletions apps/comments/lib/Activity/Provider.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
Expand Down
1 change: 1 addition & 0 deletions apps/comments/lib/Activity/Setting.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
Expand Down
1 change: 1 addition & 0 deletions apps/comments/lib/AppInfo/Application.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
Expand Down
1 change: 1 addition & 0 deletions apps/comments/lib/Collaboration/CommentersSorter.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
Expand Down
3 changes: 2 additions & 1 deletion apps/comments/lib/Controller/NotificationsController.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
Expand Down Expand Up @@ -69,7 +70,7 @@ public function view(string $id): RedirectResponse|NotFoundResponse {
return new NotFoundResponse();
}
$userFolder = $this->rootFolder->getUserFolder($currentUser->getUID());
$files = $userFolder->getById((int)$comment->getObjectId());
$files = $userFolder->getById((int) $comment->getObjectId());

$this->markProcessed($comment, $currentUser);

Expand Down
2 changes: 1 addition & 1 deletion apps/comments/lib/Listener/CommentsEntityEventListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function handle(Event $event): void {
}

$event->addEntityCollection('files', function ($name): bool {
$nodes = $this->rootFolder->getUserFolder($this->userId)->getById((int)$name);
$nodes = $this->rootFolder->getUserFolder($this->userId)->getById((int) $name);
return !empty($nodes);
});
}
Expand Down
2 changes: 1 addition & 1 deletion apps/comments/lib/MaxAutoCompleteResultsInitialState.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@
}

public function getData(): int {
return (int)$this->config->getAppValue('comments', 'maxAutoCompleteResults', '10');
return (int) $this->config->getAppValue('comments', 'maxAutoCompleteResults', '10');

Check notice

Code scanning / Psalm

DeprecatedMethod

The method OCP\IConfig::getAppValue has been marked as deprecated
}
}
2 changes: 1 addition & 1 deletion apps/comments/lib/Notification/Notifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public function prepare(INotification $notification, string $languageCode): INot
throw new UnknownNotificationException('Unsupported comment object');
}
$userFolder = $this->rootFolder->getUserFolder($notification->getUser());
$nodes = $userFolder->getById((int)$parameters[1]);
$nodes = $userFolder->getById((int) $parameters[1]);
if (empty($nodes)) {
throw new AlreadyProcessedException();
}
Expand Down
1 change: 1 addition & 0 deletions apps/comments/lib/Search/Result.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
Expand Down
1 change: 1 addition & 0 deletions apps/comments/tests/Unit/Activity/ListenerTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
Expand All @@ -11,9 +12,9 @@
use Test\TestCase;

class CommentersSorterTest extends TestCase {
/** @var ICommentsManager|\PHPUnit\Framework\MockObject\MockObject */
/** @var ICommentsManager|\PHPUnit\Framework\MockObject\MockObject */
protected $commentsManager;
/** @var CommentersSorter */
/** @var CommentersSorter */
protected $sorter;

protected function setUp(): void {
Expand Down
3 changes: 2 additions & 1 deletion apps/comments/tests/Unit/EventHandlerTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
Expand All @@ -13,7 +14,7 @@
use Test\TestCase;

class EventHandlerTest extends TestCase {
/** @var CommentsEventListener */
/** @var CommentsEventListener */
protected $eventHandler;

/** @var ActivityListener|\PHPUnit\Framework\MockObject\MockObject */
Expand Down
2 changes: 1 addition & 1 deletion apps/comments/tests/Unit/Notification/ListenerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class ListenerTest extends TestCase {
/** @var IURLGenerator|\PHPUnit\Framework\MockObject\MockObject */
protected $urlGenerator;

/** @var Listener */
/** @var Listener */
protected $listener;

protected function setUp(): void {
Expand Down
1 change: 1 addition & 0 deletions apps/comments/tests/Unit/Notification/NotifierTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
Expand Down
12 changes: 6 additions & 6 deletions apps/contactsinteraction/lib/AddressBook.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ public function __construct(
* @throws Exception
*/
public function delete(): void {
throw new Exception("This addressbook is immutable");
throw new Exception('This addressbook is immutable');
}

/**
* @inheritDoc
* @throws Exception
*/
public function createFile($name, $data = null) {
throw new Exception("This addressbook is immutable");
throw new Exception('This addressbook is immutable');
}

/**
Expand All @@ -59,13 +59,13 @@ public function getChild($name): Card {
return new Card(
$this->mapper->find(
$this->getUid(),
(int)$name
(int) $name
),
$this->principalUri,
$this->getACL()
);
} catch (DoesNotExistException $ex) {
throw new NotFound("Contact does not exist: " . $ex->getMessage(), 0, $ex);
throw new NotFound('Contact does not exist: ' . $ex->getMessage(), 0, $ex);
}
}

Expand All @@ -92,7 +92,7 @@ public function childExists($name): bool {
try {
$this->mapper->find(
$this->getUid(),
(int)$name
(int) $name
);
return true;
} catch (DoesNotExistException $e) {
Expand All @@ -112,7 +112,7 @@ public function getLastModified(): ?int {
* @throws Exception
*/
public function propPatch(PropPatch $propPatch) {
throw new Exception("This addressbook is immutable");
throw new Exception('This addressbook is immutable');
}

/**
Expand Down
2 changes: 1 addition & 1 deletion apps/contactsinteraction/lib/Db/CardSearchDao.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function findExisting(IUser $user,
}
$addressbooksQuery->selectDistinct('id')
->from('addressbooks')
->where($addressbooksQuery->expr()->eq('principaluri', $cardQuery->createNamedParameter("principals/users/" . $user->getUID())));
->where($addressbooksQuery->expr()->eq('principaluri', $cardQuery->createNamedParameter('principals/users/' . $user->getUID())));
$propQuery->selectDistinct('cardid')
->from('cards_properties')
->where($propQuery->expr()->in('addressbookid', $propQuery->createFunction($addressbooksQuery->getSQL()), IQueryBuilder::PARAM_INT_ARRAY))
Expand Down
2 changes: 1 addition & 1 deletion apps/contactsinteraction/lib/Db/RecentContactMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public function findLastUpdatedForUserId(string $uid): ?int {
return null;
}

return (int)$row['last_contact'];
return (int) $row['last_contact'];
}

public function cleanUp(int $olderThan): void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ public function handle(Event $event): void {
}

if ($event->getUid() === null && $event->getEmail() === null && $event->getFederatedCloudId() === null) {
$this->logger->warning("Contact interaction event has no user identifier set");
$this->logger->warning('Contact interaction event has no user identifier set');
return;
}

if ($event->getUid() !== null && $event->getUid() === $event->getActor()->getUID()) {
$this->logger->info("Ignoring contact interaction with self");
$this->logger->info('Ignoring contact interaction with self');
return;
}

Expand Down
1 change: 1 addition & 0 deletions apps/dav/appinfo/routes.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
Expand Down
2 changes: 1 addition & 1 deletion apps/dav/lib/Avatars/AvatarHome.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function createDirectory($name) {
public function getChild($name) {
$elements = pathinfo($name);
$ext = $elements['extension'] ?? '';
$size = (int)($elements['filename'] ?? '64');
$size = (int) ($elements['filename'] ?? '64');
if (!in_array($ext, ['jpeg', 'png'], true)) {
throw new MethodNotAllowed('File format not allowed');
}
Expand Down
2 changes: 1 addition & 1 deletion apps/dav/lib/Avatars/AvatarNode.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function getETag() {
public function getLastModified() {
$timestamp = $this->avatar->getFile($this->size)->getMTime();
if (!empty($timestamp)) {
return (int)$timestamp;
return (int) $timestamp;
}
return $timestamp;
}
Expand Down
Loading
Loading