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

Feature/search with invitation link #4

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions apps/cloud_federation_api/appinfo/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
'verb' => 'POST',
'root' => '/ocm',
],
// [
// 'name' => 'RequestHandler#inviteAccepted',
// 'url' => '/invite-accepted',
// 'verb' => 'POST',
// 'root' => '/ocm',
// ]
[
'name' => 'RequestHandler#inviteAccepted',
'url' => '/invite-accepted',
'verb' => 'POST',
'root' => '/ocm',
]
],
];
9 changes: 7 additions & 2 deletions apps/cloud_federation_api/lib/Capabilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
use OCP\OCM\IOCMProvider;

class Capabilities implements ICapability {
public const API_VERSION = '1.0-proposal1';
public const API_VERSION = '1.1.0';

public function __construct(
private IURLGenerator $urlGenerator,
Expand All @@ -26,17 +26,21 @@
/**
* Function an app uses to return the capabilities
*
* @return array{

Check failure on line 29 in apps/cloud_federation_api/lib/Capabilities.php

View workflow job for this annotation

GitHub Actions / static-code-analysis

ImplementedReturnTypeMismatch

apps/cloud_federation_api/lib/Capabilities.php:29:13: ImplementedReturnTypeMismatch: The inherited return type 'array<string, array<string, mixed>>' for OCP\Capabilities\ICapability::getCapabilities is different to the implemented return type for OCA\CloudFederationAPI\Capabilities::getcapabilities 'array{capabilities: list{string}, ocm: array{apiVersion: string, enabled: bool, endPoint: string, provider: string, resourceTypes: array<array-key, array{name: string, protocols: array<string, string>, shareTypes: array<array-key, string>}>}}' (see https://psalm.dev/123)

Check failure on line 29 in apps/cloud_federation_api/lib/Capabilities.php

View workflow job for this annotation

GitHub Actions / static-code-analysis

InvalidReturnType

apps/cloud_federation_api/lib/Capabilities.php:29:13: InvalidReturnType: The declared return type 'array{capabilities: list{string}, ocm: array{apiVersion: string, enabled: bool, endPoint: string, provider: string, resourceTypes: array<array-key, array{name: string, protocols: array<string, string>, shareTypes: array<array-key, string>}>}}' for OCA\CloudFederationAPI\Capabilities::getCapabilities is incorrect, got 'array{ocm: array{apiVersion: string, enabled: bool, endPoint: string, resourceTypes: array<array-key, array{name: string, protocols: array<string, string>, shareTypes: array<array-key, string>}>}}' (see https://psalm.dev/011)
* ocm: array{
* enabled: bool,
* apiVersion: string,
* endPoint: string,
* provider: string,
* resourceTypes: array{
* name: string,
* shareTypes: string[],
* protocols: array<string, string>
* }[],
* },
* },
* capabilities: array{
* string,
* }
* }
* @throws OCMArgumentException
*/
Expand All @@ -45,6 +49,7 @@

$this->provider->setEnabled(true);
$this->provider->setApiVersion(self::API_VERSION);
$this->provider->setCapabilities(['/invite-accepted', '/notifications', '/shares']);

$pos = strrpos($url, '/');
if ($pos === false) {
Expand All @@ -60,6 +65,6 @@

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

return ['ocm' => $this->provider->jsonSerialize()];

Check failure on line 68 in apps/cloud_federation_api/lib/Capabilities.php

View workflow job for this annotation

GitHub Actions / static-code-analysis

InvalidReturnStatement

apps/cloud_federation_api/lib/Capabilities.php:68:10: InvalidReturnStatement: The inferred type 'array{ocm: array{apiVersion: string, enabled: bool, endPoint: string, resourceTypes: array<array-key, array{name: string, protocols: array<string, string>, shareTypes: array<array-key, string>}>}}' does not match the declared return type 'array{capabilities: list{string}, ocm: array{apiVersion: string, enabled: bool, endPoint: string, provider: string, resourceTypes: array<array-key, array{name: string, protocols: array<string, string>, shareTypes: array<array-key, string>}>}}' for OCA\CloudFederationAPI\Capabilities::getCapabilities (see https://psalm.dev/128)
}
}
Loading
Loading