Skip to content

Commit 0daa9b8

Browse files
committed
chore: safely eliminate future 8.4 deprecation warning
RFC: https://wiki.php.net/rfc/deprecate-implicitly-nullable-types Proposed fix: `?T` Can be auto-fixed with `PHP_CodeSniffer` using the sniff `SlevomatCodingStandard.TypeHints.NullableTypeForNullDefaultValue` A TOTAL OF 281 ERRORS WERE FIXED IN 172 FILES I manually reviewed each change.
1 parent 0db659f commit 0daa9b8

File tree

138 files changed

+223
-223
lines changed

Some content is hidden

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

138 files changed

+223
-223
lines changed

apps/comments/lib/Dav/EntityCollection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ public function getChildren() {
128128
* @param \DateTime|null $datetime
129129
* @return CommentNode[]
130130
*/
131-
public function findChildren($limit = 0, $offset = 0, \DateTime $datetime = null) {
131+
public function findChildren($limit = 0, $offset = 0, ?\DateTime $datetime = null) {
132132
$comments = $this->commentsManager->getForObject($this->name, $this->id, $limit, $offset, $datetime);
133133
$result = [];
134134
foreach ($comments as $comment) {

apps/dav/lib/CardDAV/CardDavBackend.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public function __construct(
8585
IDBConnection $db,
8686
Principal $principalBackend,
8787
GroupPrincipalBackend $groupPrincipalBackend,
88-
EventDispatcherInterface $dispatcher = null,
88+
?EventDispatcherInterface $dispatcher = null,
8989
$legacyMode = false
9090
) {
9191
$this->db = $db;

apps/dav/lib/CardDAV/SyncService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ public function getLocalSystemAddressBook() {
290290
return $this->localSystemAddressBook;
291291
}
292292

293-
public function syncInstance(\Closure $progressCallback = null) {
293+
public function syncInstance(?\Closure $progressCallback = null) {
294294
$systemAddressBook = $this->getLocalSystemAddressBook();
295295
$this->userManager->callForAllUsers(function ($user) use ($progressCallback) {
296296
$this->updateUser($user);

apps/dav/lib/Connector/Sabre/Directory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ class Directory extends Node implements ICollection, IQuota, IMoveTarget {
8484
* @param ObjectTree|null $tree
8585
* @param \OCP\Share\IManager $shareManager
8686
*/
87-
public function __construct($view, $info, ObjectTree $tree = null, $shareManager = null) {
87+
public function __construct($view, $info, ?ObjectTree $tree = null, $shareManager = null) {
8888
parent::__construct($view, $info, $shareManager);
8989
$this->tree = $tree;
9090
}

apps/dav/lib/Connector/Sabre/Exception/FileLocked.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
use Exception;
2929

3030
class FileLocked extends \Sabre\DAV\Exception {
31-
public function __construct($message = '', $code = 0, Exception $previous = null) {
31+
public function __construct($message = '', $code = 0, ?Exception $previous = null) {
3232
if ($previous instanceof \OCP\Files\LockNotAcquiredException) {
3333
$message = \sprintf('Target file %s is locked by another process.', $previous->path);
3434
}

apps/dav/lib/Connector/Sabre/Exception/FileNameTooLong.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
use Exception;
2626

2727
class FileNameTooLong extends \Sabre\DAV\Exception {
28-
public function __construct($message = '', $code = 0, Exception $previous = null) {
28+
public function __construct($message = '', $code = 0, ?Exception $previous = null) {
2929
if ($message === '') {
3030
$message = 'File name is too long.';
3131
}

apps/dav/lib/Connector/Sabre/Exception/Forbidden.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class Forbidden extends \Sabre\DAV\Exception\Forbidden {
3434
* @param bool $retry
3535
* @param \Exception $previous
3636
*/
37-
public function __construct($message, $retry = false, \Exception $previous = null) {
37+
public function __construct($message, $retry = false, ?\Exception $previous = null) {
3838
parent::__construct($message, 0, $previous);
3939
$this->retry = $retry;
4040
}

apps/dav/lib/Connector/Sabre/File.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ class File extends Node implements IFile, IFileNode {
7575
* @param \OCP\Files\FileInfo $info
7676
* @param \OCP\Share\IManager $shareManager
7777
*/
78-
public function __construct($view, $info, $shareManager = null, Request $request = null) {
78+
public function __construct($view, $info, $shareManager = null, ?Request $request = null) {
7979
if (isset($request)) {
8080
$this->request = $request;
8181
} else {

apps/dav/lib/Connector/Sabre/FilesPlugin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ public function handleUpdateProperties($path, PropPatch $propPatch) {
466466
* @param \Sabre\DAV\INode $node
467467
* @throws \Sabre\DAV\Exception\BadRequest
468468
*/
469-
public function sendFileIdHeader($filePath, \Sabre\DAV\INode $node = null) {
469+
public function sendFileIdHeader($filePath, ?\Sabre\DAV\INode $node = null) {
470470
// chunked upload handling
471471
if (\OC_FileChunking::isWebdavChunk()) {
472472
list($path, $name) = \Sabre\Uri\split($filePath);

apps/dav/lib/Connector/Sabre/MaintenancePlugin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class MaintenancePlugin extends ServerPlugin {
4343
/**
4444
* @param IConfig $config
4545
*/
46-
public function __construct(IConfig $config = null) {
46+
public function __construct(?IConfig $config = null) {
4747
$this->config = $config;
4848
if ($config === null) {
4949
$this->config = \OC::$server->getConfig();

0 commit comments

Comments
 (0)