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

[stable20] Fix psalm errors #24686

Closed
wants to merge 1 commit into from
Closed

Conversation

juliusknorr
Copy link
Member

@juliusknorr juliusknorr commented Dec 14, 2020

ERROR: NullArgument - lib/private/Http/Client/Client.php:109:60 - Argument 1 of OCP\ICertificateManager::getAbsoluteBundlePath cannot be null, null value provided to parameter with type string (see https://psalm.dev/057)
return $this->certificateManager->getAbsoluteBundlePath(null);

Caused by #24556

For the other ones I'm not sure where they are coming from:

ERROR: InvalidNullableReturnType - lib/private/Avatar/Avatar.php:145:13 - The declared return type 'bool|string' for OC\Avatar\Avatar::generateAvatarFromSvg is not nullable, but 'false|null|string' contains null (see https://psalm.dev/144)
* @return string|boolean

ERROR: ImplicitToStringCast - lib/private/Avatar/Avatar.php:159:25 - Argument 1 of OC_Image::loadFromData expects string, Imagick provided with a __toString method (see https://psalm.dev/060)
$image->loadFromData($avatar);

ERROR: NullableReturnStatement - lib/private/Avatar/Avatar.php:160:11 - The declared return type 'bool|string' for OC\Avatar\Avatar::generateAvatarFromSvg is not nullable, but the function returns 'null|string' (see https://psalm.dev/139)
return $image->data();

@juliusknorr juliusknorr added 3. to review Waiting for reviews bug labels Dec 14, 2020
@juliusknorr juliusknorr marked this pull request as ready for review December 14, 2020 08:28
@juliusknorr
Copy link
Member Author

Strange, I don't get those locally:

Run composer run psalm -- --monochrome --no-progress --output-format=text --update-baseline || ( git diff -- . ':!lib/composer' && exit 1 )
> psalm '--monochrome' '--no-progress' '--output-format=text' '--update-baseline'
/home/runner/work/server/server/lib/private/Files/Stream/Encryption.php:449:16:error - UndefinedInterfaceMethod: Method OCP\Files\Cache\ICacheEntry::offsetGet does not exist
/home/runner/work/server/server/lib/private/Files/Stream/Encryption.php:501:59:error - InvalidScalarArgument: Argument 2 of OCP\Encryption\IEncryptionModule::decrypt expects string, int|non-empty-lowercase-string provided
Script psalm handling the psalm event returned with error code 1
Error: Process completed with exit code 1.

Signed-off-by: Julius Härtl <jus@bitgrid.net>
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
@ChristophWurst ChristophWurst force-pushed the bugfix/noid/psalm-errors branch from 57a298f to 506c086 Compare December 28, 2020 10:29
@faily-bot
Copy link

faily-bot bot commented Dec 28, 2020

🤖 beep boop beep 🤖

Here are the logs for the failed build:

Status of 747: failure

jsunit

checkers

litmus

caldavtester-new-endpoint

caldavtester-old-endpoint

carddavtester-new-endpoint

carddavtester-old-endpoint

samba

sqlite-php7.3-webdav-apache

nodb

sqlite

mariadb10.1-php7.2

mariadb10.4-php7.3

mysql8.0-php7.2

mysql5.6-php7.2

postgres9-php7.3

postgres11-php7.2

integration-capabilities_features

integration-federation_features

integration-auth

integration-maintenance-mode

integration-ratelimiting

integration-carddav

integration-dav-v2

integration-ocs-v1

integration-checksums-v1

integration-external-storage

integration-provisioning-v1

integration-tags

integration-caldav

integration-comments

integration-comments-search

integration-favorites

integration-provisioning-v2

integration-webdav-related

integration-sharees-features

integration-sharees-v2-features

integration-sharing-v1

integration-sharing-v1-part2

integration-sharing-v1-part3

integration-sharing-v1-video-verification

integration-setup-features

integration-filesdrop-features

integration-transfer-ownership-features

integration-ldap-features

integration-ldap-openldap-features

integration-ldap-openldap-uid-features-php54-api

integration-ldap-openldap-uid-features

integration-ldap-openldap-numerical-id-features

integration-trashbin

integration-remote-api

integration-download

acceptance-access-levels

acceptance-app-files

acceptance-app-files-sharing

acceptance-app-files-sharing-link

acceptance-app-files-tags

acceptance-app-theming

acceptance-header

acceptance-login

acceptance-users

acceptance-apps

object-store-s3

object-store-azure

memcache-memcached

@rullzer rullzer closed this Feb 11, 2021
@rullzer rullzer deleted the bugfix/noid/psalm-errors branch February 11, 2021 09:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants