#89766Use ArrayObject for services instead of array for middleware services
Description
Symfony 4.4 deprecated support for non-object services:
https://github.com/symfony/dependency-injection/commit/6f11b359ab9cc97838bc9fa7cf1480528bdcb54f
Symfony 5.0 introduced type declaration in Container->set which causes an exception when we set synthetic boolean services:
https://github.com/symfony/dependency-injection/blob/501d3378459fdc7993dc29b55c7d14fc27172768/Container.php#L144
Middlewares due not break (yet) as they are not set as synthetic service, but it is likely that they may break due to a type declaration that could be introduced in a 5.x release.
As array is no longer officially supported we should migrate to ArrayObject as preventative measure.