diff options
Diffstat (limited to 'lib/public')
59 files changed, 71 insertions, 71 deletions
diff --git a/lib/public/Accounts/IAccount.php b/lib/public/Accounts/IAccount.php index e024ced5bda..5a5c838f398 100644 --- a/lib/public/Accounts/IAccount.php +++ b/lib/public/Accounts/IAccount.php @@ -154,7 +154,7 @@ interface IAccount extends \JsonSerializable { * @param string $verified \OCP\Accounts\IAccountManager::NOT_VERIFIED | \OCP\Accounts\IAccountManager::VERIFICATION_IN_PROGRESS | \OCP\Accounts\IAccountManager::VERIFIED * @return IAccountProperty[] */ - public function getFilteredProperties(string $scope = null, string $verified = null): array; + public function getFilteredProperties(?string $scope = null, ?string $verified = null): array; /** * Get the related user for the account data diff --git a/lib/public/Activity/IEventMerger.php b/lib/public/Activity/IEventMerger.php index d72106b24f7..3b6cc179efa 100644 --- a/lib/public/Activity/IEventMerger.php +++ b/lib/public/Activity/IEventMerger.php @@ -57,5 +57,5 @@ interface IEventMerger { * @return IEvent * @since 11.0 */ - public function mergeEvents($mergeParameter, IEvent $event, IEvent $previousEvent = null); + public function mergeEvents($mergeParameter, IEvent $event, ?IEvent $previousEvent = null); } diff --git a/lib/public/Activity/IManager.php b/lib/public/Activity/IManager.php index 9130c6b6b90..8340b54f757 100644 --- a/lib/public/Activity/IManager.php +++ b/lib/public/Activity/IManager.php @@ -161,7 +161,7 @@ interface IManager { * @throws \UnexpectedValueException If the user is invalid * @since 9.0.1 */ - public function setCurrentUserId(string $currentUserId = null): void; + public function setCurrentUserId(?string $currentUserId = null): void; /** * Get the user we need to use diff --git a/lib/public/Activity/IProvider.php b/lib/public/Activity/IProvider.php index 657ffdeadbc..9c032ebaec2 100644 --- a/lib/public/Activity/IProvider.php +++ b/lib/public/Activity/IProvider.php @@ -38,5 +38,5 @@ interface IProvider { * @throws \InvalidArgumentException Should be thrown if your provider does not know this event * @since 11.0.0 */ - public function parse($language, IEvent $event, IEvent $previousEvent = null); + public function parse($language, IEvent $event, ?IEvent $previousEvent = null); } diff --git a/lib/public/App/ManagerEvent.php b/lib/public/App/ManagerEvent.php index 0853ce7981d..c2c6eca4683 100644 --- a/lib/public/App/ManagerEvent.php +++ b/lib/public/App/ManagerEvent.php @@ -70,7 +70,7 @@ class ManagerEvent extends Event { * @param \OCP\IGroup[]|null $groups * @since 9.0.0 */ - public function __construct($event, $appID, array $groups = null) { + public function __construct($event, $appID, ?array $groups = null) { $this->event = $event; $this->appID = $appID; $this->groups = $groups; diff --git a/lib/public/AppFramework/Db/Entity.php b/lib/public/AppFramework/Db/Entity.php index 1ae938f6e32..e0d9eae9171 100644 --- a/lib/public/AppFramework/Db/Entity.php +++ b/lib/public/AppFramework/Db/Entity.php @@ -105,7 +105,7 @@ abstract class Entity { protected function setter(string $name, array $args): void { // setters should only work for existing attributes if (property_exists($this, $name)) { - if ($this->$name === $args[0]) { + if ($args[0] === $this->$name) { return; } $this->markFieldUpdated($name); diff --git a/lib/public/AppFramework/Db/QBMapper.php b/lib/public/AppFramework/Db/QBMapper.php index 57b996b2c0f..56957a7c912 100644 --- a/lib/public/AppFramework/Db/QBMapper.php +++ b/lib/public/AppFramework/Db/QBMapper.php @@ -59,7 +59,7 @@ abstract class QBMapper { * mapped to queries without using sql * @since 14.0.0 */ - public function __construct(IDBConnection $db, string $tableName, string $entityClass = null) { + public function __construct(IDBConnection $db, string $tableName, ?string $entityClass = null) { $this->db = $db; $this->tableName = $tableName; diff --git a/lib/public/AppFramework/Http/Response.php b/lib/public/AppFramework/Http/Response.php index d28f45f4c60..06541df2da2 100644 --- a/lib/public/AppFramework/Http/Response.php +++ b/lib/public/AppFramework/Http/Response.php @@ -141,7 +141,7 @@ class Response { * @return $this * @since 8.0.0 */ - public function addCookie($name, $value, \DateTime $expireDate = null, $sameSite = 'Lax') { + public function addCookie($name, $value, ?\DateTime $expireDate = null, $sameSite = 'Lax') { $this->cookies[$name] = ['value' => $value, 'expireDate' => $expireDate, 'sameSite' => $sameSite]; return $this; } diff --git a/lib/public/AppFramework/OCS/OCSBadRequestException.php b/lib/public/AppFramework/OCS/OCSBadRequestException.php index db146076f2a..997b2fdb025 100644 --- a/lib/public/AppFramework/OCS/OCSBadRequestException.php +++ b/lib/public/AppFramework/OCS/OCSBadRequestException.php @@ -38,7 +38,7 @@ class OCSBadRequestException extends OCSException { * @param Exception|null $previous * @since 9.1.0 */ - public function __construct($message = '', Exception $previous = null) { + public function __construct($message = '', ?Exception $previous = null) { parent::__construct($message, Http::STATUS_BAD_REQUEST, $previous); } } diff --git a/lib/public/AppFramework/OCS/OCSForbiddenException.php b/lib/public/AppFramework/OCS/OCSForbiddenException.php index ecdccb05a6f..691d31996ca 100644 --- a/lib/public/AppFramework/OCS/OCSForbiddenException.php +++ b/lib/public/AppFramework/OCS/OCSForbiddenException.php @@ -38,7 +38,7 @@ class OCSForbiddenException extends OCSException { * @param Exception|null $previous * @since 9.1.0 */ - public function __construct($message = '', Exception $previous = null) { + public function __construct($message = '', ?Exception $previous = null) { parent::__construct($message, Http::STATUS_FORBIDDEN, $previous); } } diff --git a/lib/public/AppFramework/OCS/OCSNotFoundException.php b/lib/public/AppFramework/OCS/OCSNotFoundException.php index 7a2ffb5de91..9dd2925ef11 100644 --- a/lib/public/AppFramework/OCS/OCSNotFoundException.php +++ b/lib/public/AppFramework/OCS/OCSNotFoundException.php @@ -38,7 +38,7 @@ class OCSNotFoundException extends OCSException { * @param Exception|null $previous * @since 9.1.0 */ - public function __construct($message = '', Exception $previous = null) { + public function __construct($message = '', ?Exception $previous = null) { parent::__construct($message, Http::STATUS_NOT_FOUND, $previous); } } diff --git a/lib/public/AppFramework/OCS/OCSPreconditionFailedException.php b/lib/public/AppFramework/OCS/OCSPreconditionFailedException.php index 1b661ed9943..b7064aff318 100644 --- a/lib/public/AppFramework/OCS/OCSPreconditionFailedException.php +++ b/lib/public/AppFramework/OCS/OCSPreconditionFailedException.php @@ -38,7 +38,7 @@ class OCSPreconditionFailedException extends OCSException { * @param Exception|null $previous * @since 9.1.0 */ - public function __construct($message = '', Exception $previous = null) { + public function __construct($message = '', ?Exception $previous = null) { parent::__construct($message, Http::STATUS_PRECONDITION_FAILED, $previous); } } diff --git a/lib/public/AppFramework/Utility/ITimeFactory.php b/lib/public/AppFramework/Utility/ITimeFactory.php index be1b80ff617..ee5901b5a45 100644 --- a/lib/public/AppFramework/Utility/ITimeFactory.php +++ b/lib/public/AppFramework/Utility/ITimeFactory.php @@ -50,7 +50,7 @@ interface ITimeFactory extends ClockInterface { * @return \DateTime * @since 15.0.0 */ - public function getDateTime(string $time = 'now', \DateTimeZone $timezone = null): \DateTime; + public function getDateTime(string $time = 'now', ?\DateTimeZone $timezone = null): \DateTime; /** * @param \DateTimeZone $timezone diff --git a/lib/public/BackgroundJob/IJob.php b/lib/public/BackgroundJob/IJob.php index 24d8e7aad4a..90c0804c1e1 100644 --- a/lib/public/BackgroundJob/IJob.php +++ b/lib/public/BackgroundJob/IJob.php @@ -55,7 +55,7 @@ interface IJob { * @deprecated since 25.0.0 Use start() instead. This method will be removed * with the ILogger interface */ - public function execute(IJobList $jobList, ILogger $logger = null); + public function execute(IJobList $jobList, ?ILogger $logger = null); /** * Start the background job with the registered argument diff --git a/lib/public/BackgroundJob/QueuedJob.php b/lib/public/BackgroundJob/QueuedJob.php index e93db3420b8..bac60f9be11 100644 --- a/lib/public/BackgroundJob/QueuedJob.php +++ b/lib/public/BackgroundJob/QueuedJob.php @@ -43,7 +43,7 @@ abstract class QueuedJob extends Job { * @deprecated since 25.0.0 Use start() instead. This method will be removed * with the ILogger interface */ - final public function execute($jobList, ILogger $logger = null) { + final public function execute($jobList, ?ILogger $logger = null) { $this->start($jobList); } diff --git a/lib/public/BackgroundJob/TimedJob.php b/lib/public/BackgroundJob/TimedJob.php index 8fd8fadce4f..2f91dbfdc6e 100644 --- a/lib/public/BackgroundJob/TimedJob.php +++ b/lib/public/BackgroundJob/TimedJob.php @@ -88,7 +88,7 @@ abstract class TimedJob extends Job { * @since 15.0.0 * @deprecated since 25.0.0 Use start() instead */ - final public function execute(IJobList $jobList, ILogger $logger = null) { + final public function execute(IJobList $jobList, ?ILogger $logger = null) { $this->start($jobList); } diff --git a/lib/public/Collaboration/Collaborators/ISearchResult.php b/lib/public/Collaboration/Collaborators/ISearchResult.php index 15d14d656ed..a27a52fc54a 100644 --- a/lib/public/Collaboration/Collaborators/ISearchResult.php +++ b/lib/public/Collaboration/Collaborators/ISearchResult.php @@ -34,7 +34,7 @@ interface ISearchResult { * @param array|null $exactMatches * @since 13.0.0 */ - public function addResultSet(SearchResultType $type, array $matches, array $exactMatches = null); + public function addResultSet(SearchResultType $type, array $matches, ?array $exactMatches = null); /** * @param SearchResultType $type diff --git a/lib/public/Comments/ICommentsManager.php b/lib/public/Comments/ICommentsManager.php index 3d47be3d951..3df7984387a 100644 --- a/lib/public/Comments/ICommentsManager.php +++ b/lib/public/Comments/ICommentsManager.php @@ -118,7 +118,7 @@ interface ICommentsManager { $objectId, $limit = 0, $offset = 0, - \DateTime $notOlderThan = null + ?\DateTime $notOlderThan = null ); /** @@ -201,7 +201,7 @@ interface ICommentsManager { * @return Int * @since 9.0.0 */ - public function getNumberOfCommentsForObject($objectType, $objectId, \DateTime $notOlderThan = null, $verb = ''); + public function getNumberOfCommentsForObject($objectType, $objectId, ?\DateTime $notOlderThan = null, $verb = ''); /** * @param string $objectType the object type, e.g. 'files' diff --git a/lib/public/Contacts/ContactsMenu/IEntry.php b/lib/public/Contacts/ContactsMenu/IEntry.php index 1307e2c74f7..a1c64ca56aa 100644 --- a/lib/public/Contacts/ContactsMenu/IEntry.php +++ b/lib/public/Contacts/ContactsMenu/IEntry.php @@ -63,9 +63,9 @@ interface IEntry extends JsonSerializable { * @return void */ public function setStatus(string $status, - string $statusMessage = null, - int $statusMessageTimestamp = null, - string $icon = null): void; + ?string $statusMessage = null, + ?int $statusMessageTimestamp = null, + ?string $icon = null): void; /** * Get an arbitrary property from the contact diff --git a/lib/public/DataCollector/IDataCollector.php b/lib/public/DataCollector/IDataCollector.php index 0fb914727df..def260402f9 100644 --- a/lib/public/DataCollector/IDataCollector.php +++ b/lib/public/DataCollector/IDataCollector.php @@ -39,7 +39,7 @@ interface IDataCollector { * Collects data for the given Request and Response. * @since 24.0.0 */ - public function collect(Request $request, Response $response, \Throwable $exception = null): void; + public function collect(Request $request, Response $response, ?\Throwable $exception = null): void; /** * Reset the state of the profiler. diff --git a/lib/public/Defaults.php b/lib/public/Defaults.php index 63568b27294..0b52a0f6bf0 100644 --- a/lib/public/Defaults.php +++ b/lib/public/Defaults.php @@ -50,7 +50,7 @@ class Defaults { * actual defaults * @since 6.0.0 */ - public function __construct(\OC_Defaults $defaults = null) { + public function __construct(?\OC_Defaults $defaults = null) { if ($defaults === null) { $defaults = \OC::$server->get('ThemingDefaults'); } diff --git a/lib/public/Diagnostics/IQueryLogger.php b/lib/public/Diagnostics/IQueryLogger.php index ba4c97f5b50..f1f4d623da1 100644 --- a/lib/public/Diagnostics/IQueryLogger.php +++ b/lib/public/Diagnostics/IQueryLogger.php @@ -43,7 +43,7 @@ interface IQueryLogger extends SQLLogger { * @param array|null $types * @since 8.0.0 */ - public function startQuery($sql, array $params = null, array $types = null); + public function startQuery($sql, ?array $params = null, ?array $types = null); /** * Mark the end of the current active query. Ending query should store \OCP\Diagnostics\IQuery to diff --git a/lib/public/DirectEditing/ACreateEmpty.php b/lib/public/DirectEditing/ACreateEmpty.php index 89209748e4f..66b772e4d80 100644 --- a/lib/public/DirectEditing/ACreateEmpty.php +++ b/lib/public/DirectEditing/ACreateEmpty.php @@ -70,6 +70,6 @@ abstract class ACreateEmpty { * @since 18.0.0 * @param File $file */ - public function create(File $file, string $creatorId = null, string $templateId = null): void { + public function create(File $file, ?string $creatorId = null, ?string $templateId = null): void { } } diff --git a/lib/public/Encryption/Exceptions/GenericEncryptionException.php b/lib/public/Encryption/Exceptions/GenericEncryptionException.php index 8406d0593d2..5338b221675 100644 --- a/lib/public/Encryption/Exceptions/GenericEncryptionException.php +++ b/lib/public/Encryption/Exceptions/GenericEncryptionException.php @@ -41,7 +41,7 @@ class GenericEncryptionException extends HintException { * @param \Exception|null $previous * @since 8.1.0 */ - public function __construct($message = '', $hint = '', $code = 0, \Exception $previous = null) { + public function __construct($message = '', $hint = '', $code = 0, ?\Exception $previous = null) { if (empty($message)) { $message = 'Unspecified encryption exception'; } diff --git a/lib/public/Federation/Exceptions/ProviderCouldNotAddShareException.php b/lib/public/Federation/Exceptions/ProviderCouldNotAddShareException.php index 9294f5e1d95..d3cfd6cea2d 100644 --- a/lib/public/Federation/Exceptions/ProviderCouldNotAddShareException.php +++ b/lib/public/Federation/Exceptions/ProviderCouldNotAddShareException.php @@ -42,7 +42,7 @@ class ProviderCouldNotAddShareException extends HintException { * @param int $code * @param \Exception|null $previous */ - public function __construct($message, $hint = '', $code = Http::STATUS_BAD_REQUEST, \Exception $previous = null) { + public function __construct($message, $hint = '', $code = Http::STATUS_BAD_REQUEST, ?\Exception $previous = null) { parent::__construct($message, $hint, $code, $previous); } } diff --git a/lib/public/Files/Config/IUserMountCache.php b/lib/public/Files/Config/IUserMountCache.php index 4411200c7ae..d60a7aad94b 100644 --- a/lib/public/Files/Config/IUserMountCache.php +++ b/lib/public/Files/Config/IUserMountCache.php @@ -42,7 +42,7 @@ interface IUserMountCache { * @param array|null $mountProviderClasses * @since 9.0.0 */ - public function registerMounts(IUser $user, array $mounts, array $mountProviderClasses = null); + public function registerMounts(IUser $user, array $mounts, ?array $mountProviderClasses = null); /** * Get all cached mounts for a user diff --git a/lib/public/Files/Events/Node/BeforeNodeDeletedEvent.php b/lib/public/Files/Events/Node/BeforeNodeDeletedEvent.php index c0226a9b527..8cbd1d8a3a0 100644 --- a/lib/public/Files/Events/Node/BeforeNodeDeletedEvent.php +++ b/lib/public/Files/Events/Node/BeforeNodeDeletedEvent.php @@ -35,7 +35,7 @@ class BeforeNodeDeletedEvent extends AbstractNodeEvent { * @since 28.0.0 * @deprecated 29.0.0 - use OCP\Exceptions\AbortedEventException instead */ - public function abortOperation(\Throwable $ex = null) { + public function abortOperation(?\Throwable $ex = null) { throw new AbortedEventException($ex?->getMessage() ?? 'Operation aborted'); } } diff --git a/lib/public/Files/Events/Node/BeforeNodeRenamedEvent.php b/lib/public/Files/Events/Node/BeforeNodeRenamedEvent.php index 4c2c566c8c6..7331f750267 100644 --- a/lib/public/Files/Events/Node/BeforeNodeRenamedEvent.php +++ b/lib/public/Files/Events/Node/BeforeNodeRenamedEvent.php @@ -35,7 +35,7 @@ class BeforeNodeRenamedEvent extends AbstractNodesEvent { * @since 28.0.0 * @deprecated 29.0.0 - use OCP\Exceptions\AbortedEventException instead */ - public function abortOperation(\Throwable $ex = null) { + public function abortOperation(?\Throwable $ex = null) { throw new AbortedEventException($ex?->getMessage() ?? 'Operation aborted'); } } diff --git a/lib/public/Files/ForbiddenException.php b/lib/public/Files/ForbiddenException.php index 6a0a8d7fc4b..1f45e94f55c 100644 --- a/lib/public/Files/ForbiddenException.php +++ b/lib/public/Files/ForbiddenException.php @@ -41,7 +41,7 @@ class ForbiddenException extends \Exception { * @param \Exception|null $previous previous exception for cascading * @since 9.0.0 */ - public function __construct($message, $retry, \Exception $previous = null) { + public function __construct($message, $retry, ?\Exception $previous = null) { parent::__construct($message, 0, $previous); $this->retry = $retry; } diff --git a/lib/public/Files/LockNotAcquiredException.php b/lib/public/Files/LockNotAcquiredException.php index 2cf8ea20acf..000c5320634 100644 --- a/lib/public/Files/LockNotAcquiredException.php +++ b/lib/public/Files/LockNotAcquiredException.php @@ -42,7 +42,7 @@ class LockNotAcquiredException extends \Exception { /** * @since 7.0.0 */ - public function __construct($path, $lockType, $code = 0, \Exception $previous = null) { + public function __construct($path, $lockType, $code = 0, ?\Exception $previous = null) { $message = \OCP\Util::getL10N('core')->t('Could not obtain lock type %d on "%s".', [$lockType, $path]); parent::__construct($message, $code, $previous); } diff --git a/lib/public/Files/ObjectStore/IObjectStore.php b/lib/public/Files/ObjectStore/IObjectStore.php index a202ef7c0c2..e58f41cf69d 100644 --- a/lib/public/Files/ObjectStore/IObjectStore.php +++ b/lib/public/Files/ObjectStore/IObjectStore.php @@ -54,7 +54,7 @@ interface IObjectStore { * @throws \Exception when something goes wrong, message will be logged * @since 7.0.0 */ - public function writeObject($urn, $stream, string $mimetype = null); + public function writeObject($urn, $stream, ?string $mimetype = null); /** * @param string $urn the unified resource name used to identify the object diff --git a/lib/public/Files/Storage/IChunkedFileWrite.php b/lib/public/Files/Storage/IChunkedFileWrite.php index 01f5cbbb20a..2d5825c4ee8 100644 --- a/lib/public/Files/Storage/IChunkedFileWrite.php +++ b/lib/public/Files/Storage/IChunkedFileWrite.php @@ -49,7 +49,7 @@ interface IChunkedFileWrite extends IStorage { * @throws GenericFileException * @since 26.0.0 */ - public function putChunkedWritePart(string $targetPath, string $writeToken, string $chunkId, $data, int $size = null): ?array; + public function putChunkedWritePart(string $targetPath, string $writeToken, string $chunkId, $data, ?int $size = null): ?array; /** * @param string $targetPath diff --git a/lib/public/Files/Storage/IWriteStreamStorage.php b/lib/public/Files/Storage/IWriteStreamStorage.php index f9122cd4b2c..3de2f8a25c1 100644 --- a/lib/public/Files/Storage/IWriteStreamStorage.php +++ b/lib/public/Files/Storage/IWriteStreamStorage.php @@ -44,5 +44,5 @@ interface IWriteStreamStorage extends IStorage { * @throws GenericFileException * @since 15.0.0 */ - public function writeStream(string $path, $stream, int $size = null): int; + public function writeStream(string $path, $stream, ?int $size = null): int; } diff --git a/lib/public/Files/StorageAuthException.php b/lib/public/Files/StorageAuthException.php index bc39f8e27f5..60f711af326 100644 --- a/lib/public/Files/StorageAuthException.php +++ b/lib/public/Files/StorageAuthException.php @@ -35,7 +35,7 @@ class StorageAuthException extends StorageNotAvailableException { * @param \Exception|null $previous * @since 9.0.0 */ - public function __construct($message = '', \Exception $previous = null) { + public function __construct($message = '', ?\Exception $previous = null) { $l = \OCP\Util::getL10N('core'); parent::__construct($l->t('Storage unauthorized. %s', [$message]), self::STATUS_UNAUTHORIZED, $previous); } diff --git a/lib/public/Files/StorageBadConfigException.php b/lib/public/Files/StorageBadConfigException.php index 36d7329d4b5..ac017f1edf9 100644 --- a/lib/public/Files/StorageBadConfigException.php +++ b/lib/public/Files/StorageBadConfigException.php @@ -35,7 +35,7 @@ class StorageBadConfigException extends StorageNotAvailableException { * @param \Exception|null $previous * @since 9.0.0 */ - public function __construct($message = '', \Exception $previous = null) { + public function __construct($message = '', ?\Exception $previous = null) { $l = \OCP\Util::getL10N('core'); parent::__construct($l->t('Storage incomplete configuration. %s', [$message]), self::STATUS_INCOMPLETE_CONF, $previous); } diff --git a/lib/public/Files/StorageConnectionException.php b/lib/public/Files/StorageConnectionException.php index d29398172e6..0f3f2e0e54c 100644 --- a/lib/public/Files/StorageConnectionException.php +++ b/lib/public/Files/StorageConnectionException.php @@ -35,7 +35,7 @@ class StorageConnectionException extends StorageNotAvailableException { * @param \Exception|null $previous * @since 9.0.0 */ - public function __construct($message = '', \Exception $previous = null) { + public function __construct($message = '', ?\Exception $previous = null) { $l = \OCP\Util::getL10N('core'); parent::__construct($l->t('Storage connection error. %s', [$message]), self::STATUS_NETWORK_ERROR, $previous); } diff --git a/lib/public/Files/StorageNotAvailableException.php b/lib/public/Files/StorageNotAvailableException.php index 78b004f8518..a87ed500e02 100644 --- a/lib/public/Files/StorageNotAvailableException.php +++ b/lib/public/Files/StorageNotAvailableException.php @@ -83,7 +83,7 @@ class StorageNotAvailableException extends HintException { * @param \Exception|null $previous * @since 6.0.0 */ - public function __construct($message = '', $code = self::STATUS_ERROR, \Exception $previous = null) { + public function __construct($message = '', $code = self::STATUS_ERROR, ?\Exception $previous = null) { $l = \OCP\Util::getL10N('core'); parent::__construct($message, $l->t('Storage is temporarily not available'), $code, $previous); } diff --git a/lib/public/Files/StorageTimeoutException.php b/lib/public/Files/StorageTimeoutException.php index c20711d4181..45ee4c15464 100644 --- a/lib/public/Files/StorageTimeoutException.php +++ b/lib/public/Files/StorageTimeoutException.php @@ -35,7 +35,7 @@ class StorageTimeoutException extends StorageNotAvailableException { * @param \Exception|null $previous * @since 9.0.0 */ - public function __construct($message = '', \Exception $previous = null) { + public function __construct($message = '', ?\Exception $previous = null) { $l = \OCP\Util::getL10N('core'); parent::__construct($l->t('Storage connection timeout. %s', [$message]), self::STATUS_TIMEOUT, $previous); } diff --git a/lib/public/Files/Template/ITemplateManager.php b/lib/public/Files/Template/ITemplateManager.php index f39cf65fba4..c54c9716804 100644 --- a/lib/public/Files/Template/ITemplateManager.php +++ b/lib/public/Files/Template/ITemplateManager.php @@ -80,7 +80,7 @@ interface ITemplateManager { * @param string|null $userId * @since 21.0.0 */ - public function initializeTemplateDirectory(string $path = null, string $userId = null, $copyTemplates = true): string; + public function initializeTemplateDirectory(?string $path = null, ?string $userId = null, $copyTemplates = true): string; /** * @param string $filePath diff --git a/lib/public/HintException.php b/lib/public/HintException.php index ad6eb486d4b..0e9a142e8f3 100644 --- a/lib/public/HintException.php +++ b/lib/public/HintException.php @@ -49,7 +49,7 @@ class HintException extends \Exception { * @param int $code * @param \Exception|null $previous */ - public function __construct($message, $hint = '', $code = 0, \Exception $previous = null) { + public function __construct($message, $hint = '', $code = 0, ?\Exception $previous = null) { $this->hint = $hint; parent::__construct($message, $code, $previous); } diff --git a/lib/public/IDBConnection.php b/lib/public/IDBConnection.php index 5613aa3743b..026e79c3776 100644 --- a/lib/public/IDBConnection.php +++ b/lib/public/IDBConnection.php @@ -164,7 +164,7 @@ interface IDBConnection { * @since 6.0.0 - parameter $compare was added in 8.1.0, return type changed from boolean in 8.1.0 * @deprecated 15.0.0 - use unique index and "try { $db->insert() } catch (UniqueConstraintViolationException $e) {}" instead, because it is more reliable and does not have the risk for deadlocks - see https://github.com/nextcloud/server/pull/12371 */ - public function insertIfNotExist(string $table, array $input, array $compare = null); + public function insertIfNotExist(string $table, array $input, ?array $compare = null); /** diff --git a/lib/public/IDateTimeFormatter.php b/lib/public/IDateTimeFormatter.php index f85a88b4e38..75e5f2e1cc7 100644 --- a/lib/public/IDateTimeFormatter.php +++ b/lib/public/IDateTimeFormatter.php @@ -44,7 +44,7 @@ interface IDateTimeFormatter { * @return string Formatted date string * @since 8.0.0 */ - public function formatDate($timestamp, $format = 'long', \DateTimeZone $timeZone = null, \OCP\IL10N $l = null); + public function formatDate($timestamp, $format = 'long', ?\DateTimeZone $timeZone = null, ?\OCP\IL10N $l = null); /** * Formats the date of the given timestamp @@ -62,7 +62,7 @@ interface IDateTimeFormatter { * @return string Formatted relative date string * @since 8.0.0 */ - public function formatDateRelativeDay($timestamp, $format = 'long', \DateTimeZone $timeZone = null, \OCP\IL10N $l = null); + public function formatDateRelativeDay($timestamp, $format = 'long', ?\DateTimeZone $timeZone = null, ?\OCP\IL10N $l = null); /** * Gives the relative date of the timestamp @@ -77,7 +77,7 @@ interface IDateTimeFormatter { * >= 13 month => last year, n years ago * @since 8.0.0 */ - public function formatDateSpan($timestamp, $baseTimestamp = null, \OCP\IL10N $l = null); + public function formatDateSpan($timestamp, $baseTimestamp = null, ?\OCP\IL10N $l = null); /** * Formats the time of the given timestamp @@ -94,7 +94,7 @@ interface IDateTimeFormatter { * @return string Formatted time string * @since 8.0.0 */ - public function formatTime($timestamp, $format = 'medium', \DateTimeZone $timeZone = null, \OCP\IL10N $l = null); + public function formatTime($timestamp, $format = 'medium', ?\DateTimeZone $timeZone = null, ?\OCP\IL10N $l = null); /** * Gives the relative past time of the timestamp @@ -111,7 +111,7 @@ interface IDateTimeFormatter { * >= 13 month => last year, n years ago * @since 8.0.0 */ - public function formatTimeSpan($timestamp, $baseTimestamp = null, \OCP\IL10N $l = null); + public function formatTimeSpan($timestamp, $baseTimestamp = null, ?\OCP\IL10N $l = null); /** * Formats the date and time of the given timestamp @@ -124,7 +124,7 @@ interface IDateTimeFormatter { * @return string Formatted date and time string * @since 8.0.0 */ - public function formatDateTime($timestamp, $formatDate = 'long', $formatTime = 'medium', \DateTimeZone $timeZone = null, \OCP\IL10N $l = null); + public function formatDateTime($timestamp, $formatDate = 'long', $formatTime = 'medium', ?\DateTimeZone $timeZone = null, ?\OCP\IL10N $l = null); /** * Formats the date and time of the given timestamp @@ -138,5 +138,5 @@ interface IDateTimeFormatter { * @return string Formatted relative date and time string * @since 8.0.0 */ - public function formatDateTimeRelativeDay($timestamp, $formatDate = 'long', $formatTime = 'medium', \DateTimeZone $timeZone = null, \OCP\IL10N $l = null); + public function formatDateTimeRelativeDay($timestamp, $formatDate = 'long', $formatTime = 'medium', ?\DateTimeZone $timeZone = null, ?\OCP\IL10N $l = null); } diff --git a/lib/public/IGroup.php b/lib/public/IGroup.php index 51417641e26..9739a324168 100644 --- a/lib/public/IGroup.php +++ b/lib/public/IGroup.php @@ -135,7 +135,7 @@ interface IGroup { * @return IUser[] * @since 8.0.0 */ - public function searchDisplayName(string $search, int $limit = null, int $offset = null): array; + public function searchDisplayName(string $search, ?int $limit = null, ?int $offset = null): array; /** * Get the names of the backends the group is connected to diff --git a/lib/public/IGroupManager.php b/lib/public/IGroupManager.php index a6655292398..df7321bf0d7 100644 --- a/lib/public/IGroupManager.php +++ b/lib/public/IGroupManager.php @@ -108,7 +108,7 @@ interface IGroupManager { * @return \OCP\IGroup[] * @since 8.0.0 */ - public function getUserGroups(IUser $user = null); + public function getUserGroups(?IUser $user = null); /** * @param \OCP\IUser $user diff --git a/lib/public/L10N/IFactory.php b/lib/public/L10N/IFactory.php index 35713862f07..72aa11f002c 100644 --- a/lib/public/L10N/IFactory.php +++ b/lib/public/L10N/IFactory.php @@ -78,7 +78,7 @@ interface IFactory { * @return string language code, defaults to 'en' if no other matches are found * @since 23.0.0 */ - public function findGenericLanguage(string $appId = null): string; + public function findGenericLanguage(?string $appId = null): string; /** * @param string|null $lang user language as default locale @@ -95,7 +95,7 @@ interface IFactory { * @return null|string * @since 14.0.1 */ - public function findLanguageFromLocale(string $app = 'core', string $locale = null); + public function findLanguageFromLocale(string $app = 'core', ?string $locale = null); /** * Find all available languages for an app @@ -141,7 +141,7 @@ interface IFactory { * * @since 14.0.0 */ - public function getLanguageIterator(IUser $user = null): ILanguageIterator; + public function getLanguageIterator(?IUser $user = null): ILanguageIterator; /** * returns the common language and other languages in an @@ -158,5 +158,5 @@ interface IFactory { * @return string * @since 20.0.0 */ - public function getUserLanguage(IUser $user = null): string; + public function getUserLanguage(?IUser $user = null): string; } diff --git a/lib/public/Lock/LockedException.php b/lib/public/Lock/LockedException.php index ec7701523fb..2b1377b5854 100644 --- a/lib/public/Lock/LockedException.php +++ b/lib/public/Lock/LockedException.php @@ -53,7 +53,7 @@ class LockedException extends \Exception { * @param string $readablePath since 20.0.0 * @since 8.1.0 */ - public function __construct(string $path, \Exception $previous = null, string $existingLock = null, string $readablePath = null) { + public function __construct(string $path, ?\Exception $previous = null, ?string $existingLock = null, ?string $readablePath = null) { if ($readablePath) { $message = "\"$path\"(\"$readablePath\") is locked"; } else { diff --git a/lib/public/Lock/ManuallyLockedException.php b/lib/public/Lock/ManuallyLockedException.php index 914f0392e39..bc91a9c3304 100644 --- a/lib/public/Lock/ManuallyLockedException.php +++ b/lib/public/Lock/ManuallyLockedException.php @@ -58,7 +58,7 @@ class ManuallyLockedException extends LockedException { * * @since 18.0.0 */ - public function __construct(string $path, \Exception $previous = null, ?string $existingLock = null, ?string $owner = null, int $timeout = -1) { + public function __construct(string $path, ?\Exception $previous = null, ?string $existingLock = null, ?string $owner = null, int $timeout = -1) { parent::__construct($path, $previous, $existingLock); $this->owner = $owner; $this->timeout = $timeout; diff --git a/lib/public/Log/functions.php b/lib/public/Log/functions.php index ac043b4d958..be14208103b 100644 --- a/lib/public/Log/functions.php +++ b/lib/public/Log/functions.php @@ -48,7 +48,7 @@ use function class_exists; * @return LoggerInterface * @since 24.0.0 */ -function logger(string $appId = null): LoggerInterface { +function logger(?string $appId = null): LoggerInterface { /** @psalm-suppress TypeDoesNotContainNull false-positive, it may contain null if we are logging from initialization */ if (!class_exists(OC::class) || OC::$server === null) { // If someone calls this log before Nextcloud is initialized, there is diff --git a/lib/public/Mail/IMessage.php b/lib/public/Mail/IMessage.php index bd96918c7ac..79efc1e2a71 100644 --- a/lib/public/Mail/IMessage.php +++ b/lib/public/Mail/IMessage.php @@ -79,7 +79,7 @@ interface IMessage { * @return IMessage * @since 27.0.0 */ - public function attachInline(string $body, string $name, string $contentType = null): IMessage; + public function attachInline(string $body, string $name, ?string $contentType = null): IMessage; /** * Set the from address of this message. diff --git a/lib/public/Profiler/IProfiler.php b/lib/public/Profiler/IProfiler.php index 5fa4582add7..50edabb47ff 100644 --- a/lib/public/Profiler/IProfiler.php +++ b/lib/public/Profiler/IProfiler.php @@ -67,7 +67,7 @@ interface IProfiler { * Find a profile from various search parameters * @since 24.0.0 */ - public function find(?string $url, ?int $limit, ?string $method, ?int $start, ?int $end, string $statusCode = null): array; + public function find(?string $url, ?int $limit, ?string $method, ?int $start, ?int $end, ?string $statusCode = null): array; /** * Get the list of data providers by identifier diff --git a/lib/public/Share/Exceptions/GenericShareException.php b/lib/public/Share/Exceptions/GenericShareException.php index 496aae1406b..b726ce27b91 100644 --- a/lib/public/Share/Exceptions/GenericShareException.php +++ b/lib/public/Share/Exceptions/GenericShareException.php @@ -39,7 +39,7 @@ class GenericShareException extends HintException { * @param \Exception|null $previous * @since 9.0.0 */ - public function __construct($message = '', $hint = '', $code = 0, \Exception $previous = null) { + public function __construct($message = '', $hint = '', $code = 0, ?\Exception $previous = null) { if (empty($message)) { $message = 'There was an error retrieving the share. Maybe the link is wrong, it was unshared, or it was deleted.'; } diff --git a/lib/public/SystemTag/ManagerEvent.php b/lib/public/SystemTag/ManagerEvent.php index 48bd651f7a3..802b690038a 100644 --- a/lib/public/SystemTag/ManagerEvent.php +++ b/lib/public/SystemTag/ManagerEvent.php @@ -69,7 +69,7 @@ class ManagerEvent extends Event { * @param ISystemTag|null $beforeTag * @since 9.0.0 */ - public function __construct(string $event, ISystemTag $tag, ISystemTag $beforeTag = null) { + public function __construct(string $event, ISystemTag $tag, ?ISystemTag $beforeTag = null) { $this->event = $event; $this->tag = $tag; $this->beforeTag = $beforeTag; diff --git a/lib/public/SystemTag/TagNotFoundException.php b/lib/public/SystemTag/TagNotFoundException.php index 54e96856052..8f5442bb145 100644 --- a/lib/public/SystemTag/TagNotFoundException.php +++ b/lib/public/SystemTag/TagNotFoundException.php @@ -45,7 +45,7 @@ class TagNotFoundException extends \RuntimeException { * @param string[] $tags * @since 9.0.0 */ - public function __construct(string $message = '', int $code = 0, \Exception $previous = null, array $tags = []) { + public function __construct(string $message = '', int $code = 0, ?\Exception $previous = null, array $tags = []) { parent::__construct($message, $code, $previous); $this->tags = $tags; } diff --git a/lib/public/Talk/IBroker.php b/lib/public/Talk/IBroker.php index f2b512ea4a8..67fae10253f 100644 --- a/lib/public/Talk/IBroker.php +++ b/lib/public/Talk/IBroker.php @@ -69,7 +69,7 @@ interface IBroker { */ public function createConversation(string $name, array $moderators, - IConversationOptions $options = null): IConversation; + ?IConversationOptions $options = null): IConversation; /** * Delete a conversation by id diff --git a/lib/public/User/Events/BeforePasswordUpdatedEvent.php b/lib/public/User/Events/BeforePasswordUpdatedEvent.php index ee228ae01e7..67c01dec259 100644 --- a/lib/public/User/Events/BeforePasswordUpdatedEvent.php +++ b/lib/public/User/Events/BeforePasswordUpdatedEvent.php @@ -52,7 +52,7 @@ class BeforePasswordUpdatedEvent extends Event { */ public function __construct(IUser $user, string $password, - string $recoveryPassword = null) { + ?string $recoveryPassword = null) { parent::__construct(); $this->user = $user; $this->password = $password; diff --git a/lib/public/User/Events/BeforeUserLoggedOutEvent.php b/lib/public/User/Events/BeforeUserLoggedOutEvent.php index aa81801f474..be6f2848cb2 100644 --- a/lib/public/User/Events/BeforeUserLoggedOutEvent.php +++ b/lib/public/User/Events/BeforeUserLoggedOutEvent.php @@ -41,7 +41,7 @@ class BeforeUserLoggedOutEvent extends Event { /** * @since 18.0.0 */ - public function __construct(IUser $user = null) { + public function __construct(?IUser $user = null) { parent::__construct(); $this->user = $user; } diff --git a/lib/public/User/Events/PasswordUpdatedEvent.php b/lib/public/User/Events/PasswordUpdatedEvent.php index 782d6d270ea..b6fa75e0221 100644 --- a/lib/public/User/Events/PasswordUpdatedEvent.php +++ b/lib/public/User/Events/PasswordUpdatedEvent.php @@ -52,7 +52,7 @@ class PasswordUpdatedEvent extends Event { */ public function __construct(IUser $user, string $password, - string $recoveryPassword = null) { + ?string $recoveryPassword = null) { parent::__construct(); $this->user = $user; $this->password = $password; diff --git a/lib/public/User/Events/UserLoggedOutEvent.php b/lib/public/User/Events/UserLoggedOutEvent.php index c1b97fec29c..fa22b1bd53d 100644 --- a/lib/public/User/Events/UserLoggedOutEvent.php +++ b/lib/public/User/Events/UserLoggedOutEvent.php @@ -41,7 +41,7 @@ class UserLoggedOutEvent extends Event { /** * @since 18.0.0 */ - public function __construct(IUser $user = null) { + public function __construct(?IUser $user = null) { parent::__construct(); $this->user = $user; } diff --git a/lib/public/Util.php b/lib/public/Util.php index 11229567188..9ab9895acb8 100644 --- a/lib/public/Util.php +++ b/lib/public/Util.php @@ -177,7 +177,7 @@ class Util { * @param bool $prepend * @since 4.0.0 */ - public static function addScript(string $application, string $file = null, string $afterAppId = 'core', bool $prepend = false): void { + public static function addScript(string $application, ?string $file = null, string $afterAppId = 'core', bool $prepend = false): void { if (!empty($application)) { $path = "$application/js/$file"; } else { |