-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clean up PHPDoc params and return values #40046
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Andrew Summers <[email protected]>
f8c8093
to
2c14407
Compare
@@ -183,7 +183,7 @@ public function getSupportedReportSet($uri) { | |||
public function onReport($reportName, $report, $uri) { | |||
$reportTargetNode = $this->server->tree->getNodeForPath($uri); | |||
if (!$reportTargetNode instanceof Directory || $reportName !== self::REPORT_NAME) { | |||
return; | |||
return false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks wrong. onReport is an event handler for sabre/event. false = cancel the event handler.
return without argument is null and will not cancel the event handler: https://3v4l.org/Eifl3
I don't know if we want to cancel the event handler here or not.
@@ -187,7 +187,7 @@ public function get($allowUnstable = false) { | |||
|
|||
// Refresh the file content | |||
try { | |||
$responseJson = $this->fetch($ETag, $content, $allowUnstable); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh. Please don't change it. I think the signature for fetch is actually wrong, but we should not touch it in this pr.
@@ -321,7 +321,7 @@ protected function logQueryToFile(string $sql): void { | |||
* | |||
* @param string $seqName Name of the sequence object from which the ID should be returned. | |||
* | |||
* @return string the last inserted ID. | |||
* @return int the last inserted ID. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our Connection class is a wrapper for doctrine: https://github.com/nextcloud/3rdparty/blob/9f53e69990ad79b4e25647c72ffc455918592c24/doctrine/dbal/src/Driver/Connection.php#L54
The return should be int|string|false
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks 👍
@@ -2602,7 +2602,7 @@ | |||
* | |||
* @param string $principalUri | |||
* @param string $objectUri | |||
* @return array | |||
* @return array|null |
Check failure
Code scanning / Psalm
ImplementedReturnTypeMismatch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs a PR in SabreDAV to fix the PHPDoc there as well.
@@ -157,7 +157,7 @@ | |||
* | |||
* @param string $prefixPath | |||
* | |||
* @return array | |||
* @return array|null |
Check failure
Code scanning / Psalm
ImplementedReturnTypeMismatch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs a PR in SabreDAV to fix the PHPDoc there as well.
@@ -543,7 +543,7 @@ | |||
* | |||
* @param mixed $addressBookId | |||
* @param string $cardUri | |||
* @return array | |||
* @return array|false |
Check failure
Code scanning / Psalm
ImplementedReturnTypeMismatch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs a PR in SabreDAV to fix the PHPDoc there as well.
@@ -159,7 +159,7 @@ | |||
* getPrincipalsByPrefix. | |||
* | |||
* @param string $path | |||
* @return array | |||
* @return array|null |
Check failure
Code scanning / Psalm
ImplementedReturnTypeMismatch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs a PR in SabreDAV to fix the PHPDoc there as well.
@@ -101,7 +101,7 @@ | |||
* getPrincipalsByPrefix. | |||
* | |||
* @param string $path | |||
* @return array | |||
* @return array|null |
Check failure
Code scanning / Psalm
ImplementedReturnTypeMismatch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs a PR in SabreDAV to fix the PHPDoc there as well.
@@ -65,7 +65,7 @@ | |||
* getPrincipalsByPrefix. | |||
* | |||
* @param string $path | |||
* @return array | |||
* @return array|null |
Check failure
Code scanning / Psalm
ImplementedReturnTypeMismatch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs a PR in SabreDAV to fix the PHPDoc there as well.
@@ -92,7 +92,7 @@ | |||
* | |||
* @param int $id the unique identifier to a contact | |||
* @param string $address_book_key identifier of the address book in which the contact shall be deleted | |||
* @return bool successful or not | |||
* @return bool|null successful or not |
Check failure
Code scanning / Psalm
ImplementedReturnTypeMismatch
@@ -113,7 +113,7 @@ | |||
* | |||
* @param array $properties this array if key-value-pairs defines a contact | |||
* @param string $address_book_key identifier of the address book in which the contact shall be created or updated | |||
* @return array representing the contact just created or updated | |||
* @return array|null representing the contact just created or updated |
Check failure
Code scanning / Psalm
ImplementedReturnTypeMismatch
@@ -63,7 +63,7 @@ | |||
* @param boolean $includeShared Whether to include tags for items shared with this user by others. | |||
* @param string $userId user for which to retrieve the tags, defaults to the currently | |||
* logged in user | |||
* @return \OCP\ITags | |||
* @return \OCP\ITags|null |
Check failure
Code scanning / Psalm
ImplementedReturnTypeMismatch
Summary
This just cleans up some PHPDoc issues. Nothing critical. Let me know if I touched something I shouldn't have.
Checklist