Upgrade from 4,3 to 4,4 fails with Declaration of DI\Container::get(string $id): mixed must be compatible

Upgrade from 4,3 to 4,4 fails with Declaration of DI\Container::get(string $id): mixed must be compatible

by Douglas Hammond -
Number of replies: 6

I get the error 

Declaration of DI\Container::get(string $id): mixed must be compatible with Psr\Container\ContainerInterface::get($id)

This looks to be because moodle specifies a return type of mixed where the PSR does not.

Using php 8.2 and MOODLE_404_STABLE

Average of ratings: -
In reply to Douglas Hammond

Re: Upgrade from 4,3 to 4,4 fails with Declaration of DI\Container::get(string $id): mixed must be compatible

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
We need the full trace to see where this is happening. Make sure you have Debugging enabled.
In reply to Howard Miller

Re: Upgrade from 4,3 to 4,4 fails with Declaration of DI\Container::get(string $id): mixed must be compatible

by Douglas Hammond -
I found it. https://moodle.org/plugins/auth_saml2

This plugin include an old psr and it's version seems to be the one the autoloader is using.
In reply to Douglas Hammond

Re: Upgrade from 4,3 to 4,4 fails with Declaration of DI\Container::get(string $id): mixed must be compatible

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
I've got auth_saml2 running in 4.4 with no issues at all...
In reply to Howard Miller

Re: Upgrade from 4,3 to 4,4 fails with Declaration of DI\Container::get(string $id): mixed must be compatible

by Douglas Hammond -
odd, i got it to work but had to remove the container psr from its .extlib/simplesamlphp/vendor

i'll double check in the morning. perhaps I have an old version, though it doe not show it is outdated in moodle
In reply to Douglas Hammond

Re: Upgrade from 4,3 to 4,4 fails with Declaration of DI\Container::get(string $id): mixed must be compatible

by Douglas Hammond -
That was it. upgraded and all good
Average of ratings:Useful (2)
In reply to Douglas Hammond

Re: Upgrade from 4,3 to 4,4 fails with Declaration of DI\Container::get(string $id): mixed must be compatible

by koen roggemans -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Translators
I had the same problem with our 2 servers today. For some unknown reason, the upgrade of saml_auth is not proposed.