diff options
author | Joas Schilling <213943+nickvergessen@users.noreply.github.com> | 2022-09-26 07:44:18 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-26 07:44:18 +0300 |
commit | 69938e223bfce61b43b389bee53869b8817fe03c (patch) | |
tree | 87f9c7efab2cb73e90e877d805ba84f2b94c6f5e | |
parent | 986c57463edea1dec7deb8a0916253fb79af812c (diff) | |
parent | 624f4687b38f28d932bfc824a3aa985c4fbe1c74 (diff) |
Merge pull request #1160 from nextcloud/update-master-version
Add Nextcloud 25 support on master
-rw-r--r-- | .github/workflows/update-christophwurst-nextcloud.yml | 2 | ||||
-rw-r--r-- | appinfo/info.xml | 4 | ||||
-rw-r--r-- | composer.json | 4 | ||||
-rw-r--r-- | composer.lock | 91 | ||||
-rw-r--r-- | lib/Circles/FileSharingBroadcaster.php | 2 | ||||
-rw-r--r-- | lib/Collaboration/v2/CollaboratorSearchPlugin.php | 3 | ||||
-rw-r--r-- | lib/Command/MembersSearch.php | 8 | ||||
-rw-r--r-- | lib/Cron/ContactsExistingShares.php | 81 | ||||
-rw-r--r-- | lib/Cron/GlobalSync.php | 6 | ||||
-rw-r--r-- | lib/ISearch.php | 4 | ||||
-rw-r--r-- | lib/Search/Contacts.php | 6 | ||||
-rw-r--r-- | lib/Search/FederatedUsers.php | 11 | ||||
-rw-r--r-- | lib/Search/GlobalScaleUsers.php | 4 | ||||
-rw-r--r-- | lib/Search/LocalGroups.php | 4 | ||||
-rw-r--r-- | lib/Search/LocalUsers.php | 6 | ||||
-rw-r--r-- | lib/Service/SearchService.php | 5 | ||||
-rw-r--r-- | tests/psalm-baseline.xml | 112 | ||||
-rw-r--r-- | tests/stub.phpstub | 63 |
18 files changed, 186 insertions, 230 deletions
diff --git a/.github/workflows/update-christophwurst-nextcloud.yml b/.github/workflows/update-christophwurst-nextcloud.yml index e2e5f526..50c81c6f 100644 --- a/.github/workflows/update-christophwurst-nextcloud.yml +++ b/.github/workflows/update-christophwurst-nextcloud.yml @@ -17,7 +17,7 @@ jobs: strategy: fail-fast: false matrix: - branches: ["master", "stable24", "stable23", "stable22"] + branches: ["master", "stable25", "stable24", "stable23"] name: update-christophwurst-nextcloud-${{ matrix.branches }} diff --git a/appinfo/info.xml b/appinfo/info.xml index 2be80339..708b2980 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -8,7 +8,7 @@ Those groups of people (or "circles") can then be used by any other app for sharing purpose. ]]> </description> - <version>25.0.0-alpha.0</version> + <version>26.0.0-alpha.0</version> <licence>agpl</licence> <author>Maxence Lange</author> <types> @@ -27,7 +27,7 @@ Those groups of people (or "circles") can then be used by any other app for shar <repository>https://github.com/nextcloud/circles.git</repository> <screenshot>https://raw.githubusercontent.com/nextcloud/circles/master/screenshots/0.12.0.png</screenshot> <dependencies> - <nextcloud min-version="25" max-version="25"/> + <nextcloud min-version="26" max-version="26"/> </dependencies> <default_enable/> <background-jobs> diff --git a/composer.json b/composer.json index db9128ab..c2e38e26 100644 --- a/composer.json +++ b/composer.json @@ -34,7 +34,7 @@ "require-dev": { "phpunit/phpunit": "^9.5", "vimeo/psalm": "^4.22", - "christophwurst/nextcloud": "dev-master", - "nextcloud/coding-standard": "^1.0" + "nextcloud/coding-standard": "^1.0", + "nextcloud/ocp": "dev-master" } } diff --git a/composer.lock b/composer.lock index eb6f7994..6651a4d1 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "77e116a2c846c4e9f1fc38400e07bbb5", + "content-hash": "ece3218dd2b461283ece53f386990931", "packages": [], "packages-dev": [ { @@ -174,50 +174,6 @@ "time": "2021-03-30T17:13:30+00:00" }, { - "name": "christophwurst/nextcloud", - "version": "dev-master", - "source": { - "type": "git", - "url": "https://github.com/ChristophWurst/nextcloud_composer.git", - "reference": "b7bcba48272375f8b55e1a69769337902a95d952" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ChristophWurst/nextcloud_composer/zipball/b7bcba48272375f8b55e1a69769337902a95d952", - "reference": "b7bcba48272375f8b55e1a69769337902a95d952", - "shasum": "" - }, - "require": { - "php": "^7.4 || ~8.0 || ~8.1", - "psr/container": "^1.1.1", - "psr/event-dispatcher": "^1.0", - "psr/log": "^1.1" - }, - "default-branch": true, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "25.0.0-dev" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "AGPL-3.0-or-later" - ], - "authors": [ - { - "name": "Christoph Wurst", - "email": "christoph@winzerhof-wurst.at" - } - ], - "description": "Composer package containing Nextcloud's public API (classes, interfaces)", - "support": { - "issues": "https://github.com/ChristophWurst/nextcloud_composer/issues", - "source": "https://github.com/ChristophWurst/nextcloud_composer/tree/master" - }, - "time": "2022-08-25T02:31:45+00:00" - }, - { "name": "composer/package-versions-deprecated", "version": "1.11.99.5", "source": { @@ -1105,6 +1061,49 @@ "time": "2021-11-10T08:44:10+00:00" }, { + "name": "nextcloud/ocp", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/nextcloud-deps/ocp.git", + "reference": "35711a5c821cc9589d58efa0ded87ae948ab71ed" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nextcloud-deps/ocp/zipball/35711a5c821cc9589d58efa0ded87ae948ab71ed", + "reference": "35711a5c821cc9589d58efa0ded87ae948ab71ed", + "shasum": "" + }, + "require": { + "php": "^7.4 || ~8.0 || ~8.1", + "psr/container": "^1.1.1", + "psr/event-dispatcher": "^1.0", + "psr/log": "^1.1" + }, + "default-branch": true, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "26.0.0-dev" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "AGPL-3.0-or-later" + ], + "authors": [ + { + "name": "Christoph Wurst", + "email": "christoph@winzerhof-wurst.at" + } + ], + "description": "Composer package containing Nextcloud's public API (classes, interfaces)", + "support": { + "source": "https://github.com/nextcloud-deps/ocp/tree/master" + }, + "time": "2022-09-22T12:49:25+00:00" + }, + { "name": "nikic/php-parser", "version": "v4.14.0", "source": { @@ -4844,7 +4843,7 @@ "aliases": [], "minimum-stability": "stable", "stability-flags": { - "christophwurst/nextcloud": 20 + "nextcloud/ocp": 20 }, "prefer-stable": false, "prefer-lowest": false, diff --git a/lib/Circles/FileSharingBroadcaster.php b/lib/Circles/FileSharingBroadcaster.php index 2a564319..ab84dbf7 100644 --- a/lib/Circles/FileSharingBroadcaster.php +++ b/lib/Circles/FileSharingBroadcaster.php @@ -375,7 +375,7 @@ class FileSharingBroadcaster implements IBroadcaster { $ownerCloudId->getId(), $share->getSharedBy(), $sharedByFederatedId, - Share::TYPE_USER + IShare::TYPE_USER ); } catch (\Exception $e) { $this->logger->logException( diff --git a/lib/Collaboration/v2/CollaboratorSearchPlugin.php b/lib/Collaboration/v2/CollaboratorSearchPlugin.php index 6cc49e0e..cce2c517 100644 --- a/lib/Collaboration/v2/CollaboratorSearchPlugin.php +++ b/lib/Collaboration/v2/CollaboratorSearchPlugin.php @@ -33,7 +33,6 @@ namespace OCA\Circles\Collaboration\v2; use OCA\Circles\Tools\Traits\TNCLogger; use Exception; -use OC\Share20\Share; use OCA\Circles\AppInfo\Application; use OCA\Circles\Model\Circle; use OCA\Circles\Model\Probes\CircleProbe; @@ -150,7 +149,7 @@ class CollaboratorSearchPlugin implements ISearchPlugin { 'label' => $circle->getDisplayName(), 'shareWithDescription' => $this->circleService->getDefinition($circle), 'value' => [ - 'shareType' => Share::TYPE_CIRCLE, + 'shareType' => IShare::TYPE_CIRCLE, 'shareWith' => $circle->getSingleId(), 'circle' => $circle ], diff --git a/lib/Command/MembersSearch.php b/lib/Command/MembersSearch.php index 2c58505b..ca301b76 100644 --- a/lib/Command/MembersSearch.php +++ b/lib/Command/MembersSearch.php @@ -32,8 +32,9 @@ declare(strict_types=1); namespace OCA\Circles\Command; use OC\Core\Command\Base; -use OCA\Circles\Model\FederatedUser; +use OCA\Circles\IFederatedUser; use OCA\Circles\Model\Member; +use OCA\Circles\Model\SearchResult; use OCA\Circles\Service\ConfigService; use OCA\Circles\Service\SearchService; use Symfony\Component\Console\Helper\Table; @@ -101,7 +102,7 @@ class MembersSearch extends Base { /** - * @param FederatedUser[] $result + * @param list<IFederatedUser|SearchResult> $result */ private function displaySearchResult(array $result) { $output = new ConsoleOutput(); @@ -111,6 +112,9 @@ class MembersSearch extends Base { $table->render(); foreach ($result as $entry) { + if (!$result instanceof IFederatedUser) { + continue; + } $table->appendRow( [ $entry->getSingleId(), diff --git a/lib/Cron/ContactsExistingShares.php b/lib/Cron/ContactsExistingShares.php index a71e7bd1..d3a11cdf 100644 --- a/lib/Cron/ContactsExistingShares.php +++ b/lib/Cron/ContactsExistingShares.php @@ -32,9 +32,7 @@ declare(strict_types=1); namespace OCA\Circles\Cron; use OCA\Circles\Tools\Traits\TArrayTools; -use OC\BackgroundJob\TimedJob; use OC\Share20\Share; -use OCA\Circles\AppInfo\Application; use OCA\Circles\Circles\FileSharingBroadcaster; use OCA\Circles\Db\DeprecatedCirclesRequest; use OCA\Circles\Db\DeprecatedMembersRequest; @@ -49,6 +47,8 @@ use OCA\Circles\Model\SharesToken; use OCA\Circles\Service\ConfigService; use OCA\Circles\Service\DavService; use OCA\Circles\Service\MiscService; +use OCP\AppFramework\Utility\ITimeFactory; +use OCP\BackgroundJob\TimedJob; use OCP\Files\IRootFolder; use OCP\IUserManager; use OCP\Share\Exceptions\IllegalIDChangeException; @@ -62,39 +62,42 @@ use OCP\Share\IShare; class ContactsExistingShares extends TimedJob { use TArrayTools; - - /** @var IRootFolder */ - private $rootFolder; - - /** @var IUserManager */ - private $userManager; - - /** @var DavService */ - private $davService; - - /** @var DeprecatedMembersRequest */ - private $membersRequest; - - /** @var DeprecatedCirclesRequest */ - private $circlesRequest; - - /** @var FileSharesRequest */ - private $fileSharesRequest; - - /** @var TokensRequest */ - private $tokensRequest; - - /** @var FileSharingBroadcaster */ - private $fileSharingBroadcaster; - - /** @var MiscService */ - private $miscService; - + private IRootFolder $rootFolder; + private IUserManager $userManager; + private DavService $davService; + private DeprecatedMembersRequest $membersRequest; + private DeprecatedCirclesRequest $circlesRequest; + private FileSharesRequest $fileSharesRequest; + private TokensRequest $tokensRequest; + private FileSharingBroadcaster $fileSharingBroadcaster; + private MiscService $miscService; /** * Cache constructor. */ - public function __construct() { + public function __construct( + IRootFolder $rootFolder, + IUserManager $userManager, + DavService $davService, + DeprecatedMembersRequest $membersRequest, + DeprecatedCirclesRequest $circlesRequest, + FileSharesRequest $fileSharesRequest, + TokensRequest $tokensRequest, + FileSharingBroadcaster $fileSharingBroadcaster, + MiscService $miscService, + ITimeFactory $timeFactory + ) { + parent::__construct($timeFactory); + $this->davService = $davService; + $this->rootFolder = $rootFolder; + $this->userManager = $userManager; + $this->membersRequest = $membersRequest; + $this->circlesRequest = $circlesRequest; + $this->tokensRequest = $tokensRequest; + $this->fileSharesRequest = $fileSharesRequest; + $this->fileSharingBroadcaster = $fileSharingBroadcaster; + $this->miscService = $miscService; + $this->setInterval(1); } @@ -104,20 +107,8 @@ class ContactsExistingShares extends TimedJob { */ protected function run($argument) { return; - $app = \OC::$server->query(Application::class); - $c = $app->getContainer(); - - $this->davService = $c->query(DavService::class); - $this->rootFolder = $c->query(IRootFolder::class); - $this->userManager = $c->query(IUserManager::class); - $this->membersRequest = $c->query(DeprecatedMembersRequest::class); - $this->circlesRequest = $c->query(DeprecatedCirclesRequest::class); - $this->tokensRequest = $c->query(TokensRequest::class); - $this->fileSharesRequest = $c->query(FileSharesRequest::class); - $this->fileSharingBroadcaster = $c->query(FileSharingBroadcaster::class); - $this->miscService = $c->query(MiscService::class); - - $configService = $c->query(ConfigService::class); + + $configService = \OCP\Server::get(ConfigService::class); if (!$configService->isContactsBackend()) { return; } diff --git a/lib/Cron/GlobalSync.php b/lib/Cron/GlobalSync.php index d1b55d56..44ae8109 100644 --- a/lib/Cron/GlobalSync.php +++ b/lib/Cron/GlobalSync.php @@ -31,12 +31,13 @@ declare(strict_types=1); namespace OCA\Circles\Cron; -use OC\BackgroundJob\TimedJob; use OCA\Circles\AppInfo\Application; use OCA\Circles\Service\CirclesService; use OCA\Circles\Service\GSUpstreamService; use OCA\Circles\Service\MembersService; use OCP\AppFramework\QueryException; +use OCP\AppFramework\Utility\ITimeFactory; +use OCP\BackgroundJob\TimedJob; /** * Class GlobalSync @@ -49,7 +50,8 @@ class GlobalSync extends TimedJob { /** * Cache constructor. */ - public function __construct() { + public function __construct(ITimeFactory $timeFactory) { + parent::__construct($timeFactory); $this->setInterval(10); } diff --git a/lib/ISearch.php b/lib/ISearch.php index 3300bbe5..e93ca21b 100644 --- a/lib/ISearch.php +++ b/lib/ISearch.php @@ -31,7 +31,7 @@ declare(strict_types=1); namespace OCA\Circles; -use OCA\Circles\Model\FederatedUser; +use OCA\Circles\Model\SearchResult; /** * Interface ISearch @@ -43,7 +43,7 @@ interface ISearch { /** * @param string $needle * - * @return FederatedUser[] + * @return list<SearchResult|IFederatedUser> */ public function search(string $needle): array; } diff --git a/lib/Search/Contacts.php b/lib/Search/Contacts.php index 8ef53bfd..93470052 100644 --- a/lib/Search/Contacts.php +++ b/lib/Search/Contacts.php @@ -36,14 +36,14 @@ class Contacts implements ISearch { /** * {@inheritdoc} */ - public function search($search) { + public function search($needle): array { $result = []; $contactManager = \OC::$server->getContactsManager(); // Add 'ADR' to search also in the address - $contacts = $contactManager->search($search, ['FN', 'ORG', 'EMAIL']); + $contacts = $contactManager->search($needle, ['FN', 'ORG', 'EMAIL']); foreach ($contacts as $contact) { - if (MiscService::get($contact, 'isLocalSystemBook', false) === true) { + if (($contact['isLocalSystemBook'] ?? false) === true) { continue; } diff --git a/lib/Search/FederatedUsers.php b/lib/Search/FederatedUsers.php index 56cec685..5b918b4f 100644 --- a/lib/Search/FederatedUsers.php +++ b/lib/Search/FederatedUsers.php @@ -40,11 +40,7 @@ use OCA\Circles\ISearch; * @package OCA\Circles\Search */ class FederatedUsers implements ISearch { - - - /** @var MemberRequest */ - private $memberRequest; - + private MemberRequest $memberRequest; /** * LocalUsers constructor. @@ -55,11 +51,8 @@ class FederatedUsers implements ISearch { $this->memberRequest = $memberRequest; } - /** - * @param string $needle - * - * @return array + * {@inheritdoc} */ public function search(string $needle): array { return $this->memberRequest->searchFederatedUsers($needle); diff --git a/lib/Search/GlobalScaleUsers.php b/lib/Search/GlobalScaleUsers.php index f05f6945..7e882f60 100644 --- a/lib/Search/GlobalScaleUsers.php +++ b/lib/Search/GlobalScaleUsers.php @@ -70,7 +70,7 @@ class GlobalScaleUsers implements ISearch { /** * {@inheritdoc} */ - public function search(string $search): array { + public function search(string $needle): array { /** @var string $lookup */ try { @@ -82,7 +82,7 @@ class GlobalScaleUsers implements ISearch { $request = new NCRequest(ConfigService::GS_LOOKUP_USERS, Request::TYPE_GET); $this->configService->configureRequest($request); $request->basedOnUrl($lookup); - $request->addParam('search', $search); + $request->addParam('search', $needle); try { $users = $this->retrieveJson($request); diff --git a/lib/Search/LocalGroups.php b/lib/Search/LocalGroups.php index 8fdac50a..d7ab6d77 100644 --- a/lib/Search/LocalGroups.php +++ b/lib/Search/LocalGroups.php @@ -35,11 +35,11 @@ class LocalGroups implements ISearch { /** * {@inheritdoc} */ - public function search($search) { + public function search($needle): array { $result = []; $groupManager = \OC::$server->getGroupManager(); - $groups = $groupManager->search($search); + $groups = $groupManager->search($needle); foreach ($groups as $group) { $result[] = new SearchResult($group->getGID(), DeprecatedMember::TYPE_GROUP); } diff --git a/lib/Search/LocalUsers.php b/lib/Search/LocalUsers.php index 21e60e21..b6f01b50 100644 --- a/lib/Search/LocalUsers.php +++ b/lib/Search/LocalUsers.php @@ -60,15 +60,15 @@ class LocalUsers implements ISearch { /** * {@inheritdoc} */ - public function search($search) { + public function search($needle): array { $result = []; $userManager = \OC::$server->getUserManager(); if ($this->configService->getAppValue(ConfigService::CIRCLES_SEARCH_FROM_COLLABORATOR) === '1') { - return $this->searchFromCollaborator($search); + return $this->searchFromCollaborator($needle); } - $users = $userManager->search($search); + $users = $userManager->search($needle); foreach ($users as $user) { $result[] = new SearchResult( diff --git a/lib/Service/SearchService.php b/lib/Service/SearchService.php index 0688f207..f1573051 100644 --- a/lib/Service/SearchService.php +++ b/lib/Service/SearchService.php @@ -35,9 +35,10 @@ use OC; use OCA\Circles\AppInfo\Application; use OCA\Circles\Exceptions\InitiatorNotFoundException; use OCA\Circles\Exceptions\RequestBuilderException; +use OCA\Circles\IFederatedUser; use OCA\Circles\ISearch; use OCA\Circles\Model\Circle; -use OCA\Circles\Model\FederatedUser; +use OCA\Circles\Model\SearchResult; use OCA\Circles\Model\Member; use OCA\Circles\Model\Probes\CircleProbe; use OCA\Circles\Search\FederatedUsers; @@ -77,7 +78,7 @@ class SearchService { /** * @param string $needle * - * @return FederatedUser[] + * @return list<SearchResult|IFederatedUser> */ public function search(string $needle): array { $result = []; diff --git a/tests/psalm-baseline.xml b/tests/psalm-baseline.xml index b5dd4c68..67acb41a 100644 --- a/tests/psalm-baseline.xml +++ b/tests/psalm-baseline.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<files psalm-version="4.22.0@fc2c6ab4d5fa5d644d8617089f012f3bb84b8703"> +<files psalm-version="4.26.0@6998fabb2bf528b65777bf9941920888d23c03ac"> <file src="lib/Activity/Provider.php"> <ParamNameMismatch occurrences="1"> <code>$lang</code> @@ -25,10 +25,8 @@ <code>!$sendPasswordByMail</code> <code>$sendPasswordByMail</code> </TypeDoesNotContainType> - <UndefinedClass occurrences="3"> + <UndefinedClass occurrences="1"> <code>Notifications</code> - <code>Share</code> - <code>Share</code> </UndefinedClass> <UndefinedDocblockClass occurrences="2"> <code>$this->federationNotifications</code> @@ -49,11 +47,6 @@ <code>$this->federatedUserService->getCurrentUser()</code> </NullableReturnStatement> </file> - <file src="lib/Collaboration/v2/CollaboratorSearchPlugin.php"> - <UndefinedClass occurrences="1"> - <code>Share</code> - </UndefinedClass> - </file> <file src="lib/Command/CirclesCheck.php"> <UndefinedClass occurrences="1"> <code>AppConfig</code> @@ -152,8 +145,6 @@ <NullableReturnStatement occurrences="2"> <code>null</code> <code>null</code> - <code>null</code> - <code>null</code> </NullableReturnStatement> </file> <file src="lib/Db/DeprecatedMembersRequest.php"> @@ -251,9 +242,6 @@ <code>!$sendPasswordByMail</code> <code>$sendPasswordByMail</code> </TypeDoesNotContainType> - <UndefinedClass occurrences="1"> - <code>Share</code> - </UndefinedClass> <UndefinedInterfaceMethod occurrences="3"> <code>setHtmlBody</code> <code>setPlainBody</code> @@ -471,6 +459,9 @@ </InvalidReturnType> </file> <file src="lib/Model/ShareWrapper.php"> + <InvalidArgument occurrences="1"> + <code>Cache::cacheEntryFromData($this->getFileCache()->toCache(), OC::$server->getMimeTypeLoader())</code> + </InvalidArgument> <InvalidNullableReturnType occurrences="5"> <code>Circle</code> <code>FileCacheWrapper</code> @@ -485,9 +476,6 @@ <code>$this->owner</code> <code>$this->shareToken</code> </NullableReturnStatement> - <UndefinedClass occurrences="1"> - <code>Share</code> - </UndefinedClass> </file> <file src="lib/Model/SharesToken.php"> <InvalidScalarArgument occurrences="1"> @@ -516,69 +504,6 @@ <code>ExternalStorage</code> </UndefinedClass> </file> - <file src="lib/Search/Contacts.php"> - <InvalidArgument occurrences="1"> - <code>false</code> - </InvalidArgument> - <InvalidReturnStatement occurrences="1"> - <code>$result</code> - </InvalidReturnStatement> - <InvalidReturnType occurrences="1"> - <code>search</code> - </InvalidReturnType> - <MethodSignatureMismatch occurrences="1"> - <code>Contacts</code> - </MethodSignatureMismatch> - <ParamNameMismatch occurrences="1"> - <code>$search</code> - </ParamNameMismatch> - </file> - <file src="lib/Search/FederatedUsers.php"> - <LessSpecificImplementedReturnType occurrences="1"> - <code>array</code> - </LessSpecificImplementedReturnType> - </file> - <file src="lib/Search/GlobalScaleUsers.php"> - <InvalidReturnStatement occurrences="1"> - <code>$result</code> - </InvalidReturnStatement> - <InvalidReturnType occurrences="1"> - <code>array</code> - </InvalidReturnType> - <ParamNameMismatch occurrences="1"> - <code>$search</code> - </ParamNameMismatch> - </file> - <file src="lib/Search/LocalGroups.php"> - <InvalidReturnStatement occurrences="1"> - <code>$result</code> - </InvalidReturnStatement> - <InvalidReturnType occurrences="1"> - <code>search</code> - </InvalidReturnType> - <MethodSignatureMismatch occurrences="1"> - <code>LocalGroups</code> - </MethodSignatureMismatch> - <ParamNameMismatch occurrences="1"> - <code>$search</code> - </ParamNameMismatch> - </file> - <file src="lib/Search/LocalUsers.php"> - <InvalidReturnStatement occurrences="1"> - <code>$result</code> - </InvalidReturnStatement> - <MethodSignatureMismatch occurrences="1"> - <code>LocalUsers</code> - </MethodSignatureMismatch> - <ParamNameMismatch occurrences="1"> - <code>$search</code> - </ParamNameMismatch> - </file> - <file src="lib/Service/CircleService.php"> - <MismatchingDocblockParamType occurrences="1"> - <code>CircleProbe|null</code> - </MismatchingDocblockParamType> - </file> <file src="lib/Service/CirclesService.php"> <InvalidScalarArgument occurrences="1"> <code>$type</code> @@ -602,11 +527,6 @@ <code>isFederatedCirclesAllowed</code> </UndefinedMethod> </file> - <file src="lib/Service/ConfigService.php"> - <UndefinedPropertyFetch occurrences="1"> - <code>OC::$WEBROOT</code> - </UndefinedPropertyFetch> - </file> <file src="lib/Service/ContactService.php"> <TypeDoesNotContainNull occurrences="1"> <code>is_null($contactId)</code> @@ -791,23 +711,13 @@ </ParamNameMismatch> </file> <file src="lib/ShareByCircleProviderDeprecated.php"> - <ImplementedReturnTypeMismatch occurrences="4"> + <ImplementedReturnTypeMismatch occurrences="2"> <code>IShare[]|null</code> - <code>Share</code> - <code>Share[]</code> <code>Share[]</code> </ImplementedReturnTypeMismatch> - <InvalidReturnStatement occurrences="4"> - <code>$shares</code> + <InvalidReturnStatement occurrences="1"> <code>$this->createShareChild($userId, $share)</code> - <code>$this->createShareObject($data)</code> - <code>$this->getShareById($share->getId())</code> </InvalidReturnStatement> - <InvalidReturnType occurrences="3"> - <code>IShare</code> - <code>Share</code> - <code>Share[]</code> - </InvalidReturnType> <InvalidScalarArgument occurrences="6"> <code>$id</code> <code>$share->getId()</code> @@ -833,15 +743,9 @@ <TypeDoesNotContainNull occurrences="1"> <code>$arr === null</code> </TypeDoesNotContainNull> - <UndefinedClass occurrences="2"> + <UndefinedClass occurrences="1"> <code>InvalidShare</code> - <code>Share</code> </UndefinedClass> - <UndefinedDocblockClass occurrences="3"> - <code>Share</code> - <code>Share[]</code> - <code>Share[]</code> - </UndefinedDocblockClass> <UndefinedMethod occurrences="1"/> </file> <file src="lib/Tools/ActivityPub/NCSignature.php"> diff --git a/tests/stub.phpstub b/tests/stub.phpstub index 291a8440..20c934f1 100644 --- a/tests/stub.phpstub +++ b/tests/stub.phpstub @@ -364,6 +364,7 @@ namespace { static $CLI = false; /** @var IServerContainer */ static $server; + static $WEBROOT; } } @@ -1021,3 +1022,65 @@ namespace OC\Files\Storage\Wrapper{ namespace OC\AppFramework\Middleware\Security\Exceptions { class NotLoggedInException extends \Exception {} } + +namespace OC\Share20 { + use OCP\Files\Node; + + class Share implements \OCP\Share\IShare { + public function __construct(\OCP\Files\IRootFolder $rootFolder, \OCP\IUserManager $userManager) {} + public function setId($id) {} + public function getId() {} + public function getFullId() {} + public function setProviderId($id) {} + public function setNode(Node $node) {} + public function getNode() {} + public function setNodeId($fileId) {} + public function getNodeId() {} + public function setNodeType($type) {} + public function getNodeType() {} + public function setShareType($shareType) {} + public function getShareType() {} + public function setSharedWith($sharedWith) {} + public function getSharedWith() {} + public function setSharedWithDisplayName($displayName) {} + public function getSharedWithDisplayName() {} + public function setSharedWithAvatar($src) {} + public function getSharedWithAvatar() {} + public function setPermissions($permissions) {} + public function getPermissions() {} + public function newAttributes(): \OCP\Share\IAttributes {} + public function setAttributes(?\OCP\Share\IAttributes $attributes) {} + public function getAttributes(): ?\OCP\Share\IAttributes {} + public function setStatus(int $status): \OCP\Share\IShare {} + public function getStatus(): int {} + public function setNote($note) {} + public function getNote() {} + public function setExpirationDate($expireDate) {} + public function getExpirationDate() {} + public function isExpired() {} + public function setLabel($label) {} + public function getLabel() {} + public function setSharedBy($sharedBy) {} + public function getSharedBy() {} + public function setShareOwner($shareOwner) {} + public function getShareOwner() {} + public function setPassword($password) {} + public function getPassword() {} + public function setPasswordExpirationTime(?\DateTimeInterface $passwordExpirationTime = null): \OCP\Share\IShare {} + public function getPasswordExpirationTime(): ?\DateTimeInterface {} + public function setSendPasswordByTalk(bool $sendPasswordByTalk) {} + public function getSendPasswordByTalk(): bool {} + public function setToken($token) {} + public function getToken() {} + public function setTarget($target) {} + public function getTarget() {} + public function setShareTime(\DateTime $shareTime) {} + public function getShareTime() {} + public function setMailSend($mailSend) {} + public function getMailSend() {} + public function setNodeCacheEntry(OCP\Files\Cache\ICacheEntry $entry) {} + public function getNodeCacheEntry() {} + public function setHideDownload(bool $hide): \OCP\Share\IShare; + public function getHideDownload(): bool; + } +} |