api-library
api-library copied to clipboard
Mautic API not working with Psr/Log v3
Declaration of Mautic\Api\Api::setLogger(Psr\Log\LoggerInterface $logger) must be compatible with Psr\Log\LoggerAwareInterface::setLogger(Psr\Log\LoggerInterface $logger): void {"userId":27,"exception":"[object] (Symfony\Component\ErrorHandler\Error\FatalError(code: 0): Declaration of Mautic\Api\Api::setLogger(Psr\Log\LoggerInterface $logger) must be compatible with Psr\Log\LoggerAwareInterface::setLogger(Psr\Log\LoggerInterface $logger): void at /vendor/mautic/api-library/lib/Api/Api.php:127)
I fixed this by forcing "psr/log": "~2.0". Note that I'm using Laravel 10 which I think upgraded it to v3.0
I'm also using: "mautic/api-library": "^3.1.0",
Can you try updating to the changes in the main branch? It should have been fixed there but not yet released.
Can you try updating to the changes in the
mainbranch? It should have been fixed there but not yet released.
not too sure how to do that. But I'll just wait for the official release. Do we know when that would be? Thank you!
Here is how to checkout a branch with Composer: https://getcomposer.org/doc/articles/versions.md#branches
There is no release date at the moment.
Had the same error, I managed to solve it by activating the PSR extension in PHP. In my case the PSR extension was not activated by default on my install.
Since I cannot create a PR for a git tag here is a patch for tag 3.1.0 (taken from https://github.com/mautic/api-library/compare/3.1.0...theodorosploumis:api-library:3.1.0.patch)