diff options
-rw-r--r-- | apps/theming/lib/Controller/IconController.php | 3 | ||||
-rw-r--r-- | apps/theming/lib/ThemingDefaults.php | 3 | ||||
-rw-r--r-- | build/psalm-baseline.xml | 109 | ||||
-rw-r--r-- | composer.json | 2 | ||||
-rw-r--r-- | lib/public/AppFramework/Bootstrap/IRegistrationContext.php | 4 |
5 files changed, 8 insertions, 113 deletions
diff --git a/apps/theming/lib/Controller/IconController.php b/apps/theming/lib/Controller/IconController.php index 4235c66a457..da6668c4906 100644 --- a/apps/theming/lib/Controller/IconController.php +++ b/apps/theming/lib/Controller/IconController.php @@ -107,8 +107,7 @@ class IconController extends Controller { * @NoCSRFRequired * * @param $app string app name - * @psalm-return FileDisplayResponse|DataDisplayResponse - * @return Response + * @return FileDisplayResponse|DataDisplayResponse * @throws \Exception */ public function getFavicon(string $app = 'core'): Response { diff --git a/apps/theming/lib/ThemingDefaults.php b/apps/theming/lib/ThemingDefaults.php index aafeb2498b6..74b75372083 100644 --- a/apps/theming/lib/ThemingDefaults.php +++ b/apps/theming/lib/ThemingDefaults.php @@ -158,6 +158,7 @@ class ThemingDefaults extends \OC_Defaults { } /** + * We pass a string and sanitizeHTML will return a string to in that case * @psalm-suppress InvalidReturnStatement * @psalm-suppress InvalidReturnType */ @@ -407,7 +408,7 @@ class ThemingDefaults extends \OC_Defaults { /** * Increases the cache buster key */ - private function increaseCacheBuster() { + private function increaseCacheBuster(): void { $cacheBusterKey = (int)$this->config->getAppValue('theming', 'cachebuster', '0'); $this->config->setAppValue('theming', 'cachebuster', (string)($cacheBusterKey + 1)); $this->cacheFactory->createDistributed('theming-')->clear(); diff --git a/build/psalm-baseline.xml b/build/psalm-baseline.xml index 32336871816..b088c439066 100644 --- a/build/psalm-baseline.xml +++ b/build/psalm-baseline.xml @@ -36,11 +36,6 @@ <code>array</code> </LessSpecificImplementedReturnType> </file> - <file src="apps/admin_audit/lib/AppInfo/Application.php"> - <InvalidArgument occurrences="1"> - <code>registerEventListener</code> - </InvalidArgument> - </file> <file src="apps/cloud_federation_api/lib/Controller/RequestHandlerController.php"> <InvalidScalarArgument occurrences="1"> <code>$e->getCode()</code> @@ -49,12 +44,6 @@ <code>!is_array($notification)</code> </TypeDoesNotContainType> </file> - <file src="apps/comments/lib/AppInfo/Application.php"> - <InvalidArgument occurrences="2"> - <code>registerEventListener</code> - <code>registerEventListener</code> - </InvalidArgument> - </file> <file src="apps/comments/lib/Search/Result.php"> <InvalidScalarArgument occurrences="1"> <code>(int) $comment->getId()</code> @@ -65,11 +54,6 @@ <code>\Sabre\Uri\split($this->principalUri)</code> </UndefinedFunction> </file> - <file src="apps/contactsinteraction/lib/AppInfo/Application.php"> - <InvalidArgument occurrences="1"> - <code>registerEventListener</code> - </InvalidArgument> - </file> <file src="apps/dav/appinfo/v1/caldav.php"> <TooManyArguments occurrences="1"> <code>new \Sabre\DAV\Auth\Plugin($authBackend, 'ownCloud')</code> @@ -128,36 +112,7 @@ </MissingFile> </file> <file src="apps/dav/lib/AppInfo/Application.php"> - <InvalidArgument occurrences="28"> - <code>registerEventListener</code> - <code>registerEventListener</code> - <code>registerEventListener</code> - <code>registerEventListener</code> - <code>registerEventListener</code> - <code>registerEventListener</code> - <code>registerEventListener</code> - <code>registerEventListener</code> - <code>registerEventListener</code> - <code>registerEventListener</code> - <code>registerEventListener</code> - <code>registerEventListener</code> - <code>registerEventListener</code> - <code>registerEventListener</code> - <code>registerEventListener</code> - <code>registerEventListener</code> - <code>registerEventListener</code> - <code>registerEventListener</code> - <code>registerEventListener</code> - <code>registerEventListener</code> - <code>registerEventListener</code> - <code>registerEventListener</code> - <code>registerEventListener</code> - <code>registerEventListener</code> - <code>registerEventListener</code> - <code>registerEventListener</code> - <code>registerEventListener</code> - <code>registerEventListener</code> - </InvalidArgument> + <InvalidArgument occurrences="1"/> <UndefinedInterfaceMethod occurrences="1"> <code>getAppDataDir</code> </UndefinedInterfaceMethod> @@ -1132,11 +1087,6 @@ <code>$userSession</code> </RedundantCondition> </file> - <file src="apps/federatedfilesharing/lib/AppInfo/Application.php"> - <InvalidArgument occurrences="1"> - <code>registerEventListener</code> - </InvalidArgument> - </file> <file src="apps/federatedfilesharing/lib/Controller/RequestHandlerController.php"> <InvalidScalarArgument occurrences="7"> <code>$id</code> @@ -1191,11 +1141,6 @@ <code>null</code> </NullableReturnStatement> </file> - <file src="apps/federation/lib/AppInfo/Application.php"> - <InvalidArgument occurrences="1"> - <code>registerEventListener</code> - </InvalidArgument> - </file> <file src="apps/federation/lib/TrustedServers.php"> <InvalidArgument occurrences="1"> <code>'OCP\Federation\TrustedServerEvent::remove'</code> @@ -1240,12 +1185,6 @@ <code>10 * 1024 * 1024</code> </InvalidScalarArgument> </file> - <file src="apps/files/lib/AppInfo/Application.php"> - <InvalidArgument occurrences="2"> - <code>registerEventListener</code> - <code>registerEventListener</code> - </InvalidArgument> - </file> <file src="apps/files/lib/Command/Scan.php"> <NullArgument occurrences="1"> <code>null</code> @@ -1335,12 +1274,6 @@ <code>$this</code> </InvalidScope> </file> - <file src="apps/files_external/lib/AppInfo/Application.php"> - <InvalidArgument occurrences="2"> - <code>registerEventListener</code> - <code>registerEventListener</code> - </InvalidArgument> - </file> <file src="apps/files_external/lib/Command/Delete.php"> <NullArgument occurrences="1"> <code>null</code> @@ -1838,12 +1771,6 @@ <code>$this</code> </InvalidScope> </file> - <file src="apps/files_versions/lib/AppInfo/Application.php"> - <InvalidArgument occurrences="2"> - <code>registerEventListener</code> - <code>registerEventListener</code> - </InvalidArgument> - </file> <file src="apps/files_versions/lib/Sabre/RestoreFolder.php"> <InvalidNullableReturnType occurrences="1"> <code>getChild</code> @@ -1887,11 +1814,6 @@ <file src="apps/oauth2/lib/Db/ClientMapper.php"> <InvalidCatch occurrences="2"/> </file> - <file src="apps/provisioning_api/lib/AppInfo/Application.php"> - <InvalidArgument occurrences="1"> - <code>registerEventListener</code> - </InvalidArgument> - </file> <file src="apps/provisioning_api/lib/Controller/UsersController.php"> <InvalidScalarArgument occurrences="1"> <code>$quota</code> @@ -1902,11 +1824,7 @@ </TypeDoesNotContainNull> </file> <file src="apps/settings/lib/AppInfo/Application.php"> - <InvalidArgument occurrences="3"> - <code>registerEventListener</code> - <code>registerEventListener</code> - <code>registerEventListener</code> - </InvalidArgument> + <InvalidArgument occurrences="1"/> <InvalidScalarArgument occurrences="1"> <code>\OC_User::getUser()</code> </InvalidScalarArgument> @@ -1978,19 +1896,6 @@ <code>$event->getObjectId()</code> </InvalidScalarArgument> </file> - <file src="apps/theming/lib/AppInfo/Application.php"> - <InvalidArgument occurrences="1"> - <code>registerEventListener</code> - </InvalidArgument> - </file> - <file src="apps/twofactor_backupcodes/lib/AppInfo/Application.php"> - <InvalidArgument occurrences="4"> - <code>registerEventListener</code> - <code>registerEventListener</code> - <code>registerEventListener</code> - <code>registerEventListener</code> - </InvalidArgument> - </file> <file src="apps/twofactor_backupcodes/lib/BackgroundJob/RememberBackupCodesJob.php"> <InvalidArgument occurrences="1"> <code>bool</code> @@ -2269,20 +2174,10 @@ </TypeDoesNotContainType> </file> <file src="apps/user_status/lib/AppInfo/Application.php"> - <InvalidArgument occurrences="3"> - <code>registerEventListener</code> - <code>registerEventListener</code> - <code>registerEventListener</code> - </InvalidArgument> <UndefinedInterfaceMethod occurrences="1"> <code>registerProvider</code> </UndefinedInterfaceMethod> </file> - <file src="apps/workflowengine/lib/AppInfo/Application.php"> - <InvalidArgument occurrences="1"> - <code>registerEventListener</code> - </InvalidArgument> - </file> <file src="apps/workflowengine/lib/Check/AbstractStringCheck.php"> <NullArgument occurrences="1"> <code>null</code> diff --git a/composer.json b/composer.json index 4e191745592..70cba1623c6 100644 --- a/composer.json +++ b/composer.json @@ -43,6 +43,6 @@ "cs:check": "php-cs-fixer fix --dry-run --diff", "lint": "find . -name \\*.php -not -path './lib/composer/*' -not -path './build/stubs/*' -print0 | xargs -0 -n1 php -l", "psalm": "psalm --threads=1", - "psalm:update-baseline": "psalm --threads=1 --update-baseline --set-baseline=build/psalm-baseline.xml" + "psalm:update-baseline": "psalm --threads=1 --update-baseline" } } diff --git a/lib/public/AppFramework/Bootstrap/IRegistrationContext.php b/lib/public/AppFramework/Bootstrap/IRegistrationContext.php index 4e895b73b3d..be936540aee 100644 --- a/lib/public/AppFramework/Bootstrap/IRegistrationContext.php +++ b/lib/public/AppFramework/Bootstrap/IRegistrationContext.php @@ -122,11 +122,11 @@ interface IRegistrationContext { * * This is equivalent to calling IEventDispatcher::addServiceListener * - * @template T of \OCP\EventDispatcher\Event + * @psalm-template T of \OCP\EventDispatcher\Event * @param string $event preferably the fully-qualified class name of the Event sub class to listen for * @psalm-param string|class-string<T> $event preferably the fully-qualified class name of the Event sub class to listen for * @param string $listener fully qualified class name (or ::class notation) of a \OCP\EventDispatcher\IEventListener that can be built by the DI container - * @psalm-param class-string<\OCP\EventDispatcher\IEventListener<T>> $listener fully qualified class name that can be built by the DI container + * @psalm-param class-string<\OCP\EventDispatcher\IEventListener> $listener fully qualified class name that can be built by the DI container * @param int $priority The higher this value, the earlier an event * listener will be triggered in the chain (defaults to 0) * |