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

Fix LoggerAwareInterface #4

Merged
merged 1 commit into from
Aug 2, 2024
Merged

Fix LoggerAwareInterface #4

merged 1 commit into from
Aug 2, 2024

Conversation

nickvergessen
Copy link

Declaration of
Nextcloud\\KItinerary\\Sys\\SysAdapter::setLogger(Psr\\Log\\LoggerInterface $logger)
must be compatible with
Psr\\Log\\LoggerAwareInterface::setLogger(Psr\\Log\\LoggerInterface $logger): void

Declaration of Nextcloud\\KItinerary\\Sys\\SysAdapter::setLogger(Psr\\Log\\LoggerInterface $logger) must be compatible with Psr\\Log\\LoggerAwareInterface::setLogger(Psr\\Log\\LoggerInterface $logger): void

Signed-off-by: Joas Schilling <[email protected]>
@kesselb
Copy link

kesselb commented Aug 2, 2024

Hmm 🤔

There was this weird situation about the psr/log library and the return types. I need to check if it's really possible to declare this library as compatible with psr/log 2 and 3 at the same time due to the return type.

But the version bundled with Nextcloud 30 should be psr/log 2:

https://github.com/nextcloud/3rdparty/blob/master/psr/log/src/LoggerAwareTrait.php

/var/www/html/3rdparty$ composer show psr/log
name     : psr/log
descrip. : Common interface for logging libraries
keywords : log, psr, psr-3
versions : * 2.0.0
released : 2021-07-14, 3 years ago
type     : library
license  : MIT License (MIT) (OSI approved) https://spdx.org/licenses/MIT.html#licenseText
homepage : https://github.com/php-fig/log
source   : [git] https://github.com/php-fig/log.git ef29f6d262798707a9edd554e2b82517ef3a9376
dist     : [zip] https://api.github.com/repos/php-fig/log/zipball/ef29f6d262798707a9edd554e2b82517ef3a9376 ef29f6d262798707a9edd554e2b82517ef3a9376
path     : /var/www/html/3rdparty/psr/log
names    : psr/log

support
source : https://github.com/php-fig/log/tree/2.0.0

autoload
psr-4
Psr\Log\ => src

requires
php >=8.0.0

/var/www/html/3rdparty$ composer why psr/log
doctrine/dbal             3.8.3   requires  psr/log (^1|^2|^3)             
sabre/dav                 4.6.0   requires  psr/log (^1.0 || ^2.0 || ^3.0) 
symfony/console           v5.4.35 conflicts psr/log (>=3)                  
symfony/mailer            v5.4.22 requires  psr/log (^1|^2|^3)             
web-auth/metadata-service 4.8.5   requires  psr/log (^1.0|^2.0|^3.0)       
web-auth/webauthn-lib     4.8.5   requires  psr/log (^1.0|^2.0|^3.0)      

@nickvergessen
Copy link
Author

# grep -r 'public function setLogger(LoggerInterface $logger): void;' .
./3rdparty/web-auth/metadata-service/src/CanLogData.php:    public function setLogger(LoggerInterface $logger): void;
./apps/twofactor_webauthn/vendor/web-auth/webauthn-lib/src/MetadataService/CanLogData.php:    public function setLogger(LoggerInterface $logger): void;
./apps/twofactor_webauthn/vendor/psr/log/src/LoggerAwareInterface.php:    public function setLogger(LoggerInterface $logger): void;

twofactor_webauthn is to blame.

But it's easy being forward compatible here, it doesnt break the old cases

@kesselb kesselb merged commit 10755e6 into main Aug 2, 2024
6 checks passed
@kesselb kesselb deleted the nickvergessen-patch-1 branch August 2, 2024 13:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants