Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

summersab
Copy link
Contributor

  • Resolves: # N/A

Summary

This just cleans up some PHPDoc issues. Nothing critical. Let me know if I touched something I shouldn't have.

Checklist

Signed-off-by: Andrew Summers <18727110+summersab@users.noreply.github.com>
@@ -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;
Copy link
Contributor

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);
Copy link
Contributor

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.
Copy link
Contributor

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

Copy link
Contributor

@kesselb kesselb left a 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 Error

The inherited return type 'array<array-key, mixed>' for Sabre\CalDAV\Backend\SchedulingSupport::getSchedulingObject is different to the implemented return type for OCA\DAV\CalDAV\CalDavBackend::getschedulingobject 'array<array-key, mixed>|null'
Copy link
Member

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 Error

The inherited return type 'array<array-key, mixed>' for Sabre\DAVACL\PrincipalBackend\BackendInterface::getPrincipalByPath is different to the implemented return type for OCA\DAV\CalDAV\ResourceBooking\AbstractPrincipalBackend::getprincipalbypath 'array<array-key, mixed>|null'
Copy link
Member

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 Error

The inherited return type 'array<array-key, mixed>' for Sabre\CardDAV\Backend\BackendInterface::getCard is different to the implemented return type for OCA\DAV\CardDAV\CardDavBackend::getcard 'array<array-key, mixed>|false'
Copy link
Member

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 Error

The inherited return type 'array<array-key, mixed>' for Sabre\DAVACL\PrincipalBackend\BackendInterface::getPrincipalByPath is different to the implemented return type for OCA\DAV\Connector\Sabre\Principal::getprincipalbypath 'array<array-key, mixed>|null'
Copy link
Member

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 Error

The inherited return type 'array<array-key, mixed>' for Sabre\DAVACL\PrincipalBackend\BackendInterface::getPrincipalByPath is different to the implemented return type for OCA\DAV\DAV\GroupPrincipalBackend::getprincipalbypath 'array<array-key, mixed>|null'
Copy link
Member

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 Error

The inherited return type 'array<array-key, mixed>' for Sabre\DAVACL\PrincipalBackend\BackendInterface::getPrincipalByPath is different to the implemented return type for OCA\DAV\DAV\SystemPrincipalBackend::getprincipalbypath 'array<array-key, mixed>|null'
Copy link
Member

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 Error

The inherited return type 'bool' for OCP\Contacts\IManager::delete is different to the implemented return type for OC\ContactsManager::delete 'bool|null'
@@ -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 Error

The inherited return type 'array<array-key, mixed>' for OCP\Contacts\IManager::createOrUpdate is different to the implemented return type for OC\ContactsManager::createorupdate 'array<array-key, mixed>|null'
@@ -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 Error

The inherited return type 'OCP\ITags' for OCP\ITagManager::load is different to the implemented return type for OC\TagManager::load 'OCP\ITags|null'
@skjnldsv skjnldsv mentioned this pull request Nov 1, 2023
This was referenced Nov 6, 2023
This was referenced Nov 14, 2023
@blizzz blizzz modified the milestones: Nextcloud 28, Nextcloud 29 Nov 23, 2023
This was referenced Mar 12, 2024
This was referenced Mar 20, 2024
@skjnldsv skjnldsv mentioned this pull request Mar 28, 2024
81 tasks
@skjnldsv skjnldsv modified the milestones: Nextcloud 29, Nextcloud 30 Mar 28, 2024
@skjnldsv skjnldsv removed the 3. to review Waiting for reviews label Jul 27, 2024
@skjnldsv skjnldsv added 2. developing Work in progress stale Ticket or PR with no recent activity labels Jul 27, 2024
This was referenced Jul 30, 2024
This was referenced Aug 5, 2024
@skjnldsv skjnldsv mentioned this pull request Aug 13, 2024
@skjnldsv skjnldsv removed this from the Nextcloud 30 milestone Aug 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2. developing Work in progress developer experience stale Ticket or PR with no recent activity technical debt
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants