Task #89766

Epic #83968: PSR-11 Initiative

Use ArrayObject for services instead of array for middleware services

Added by Benjamin Franzke 6 months ago. Updated 6 months ago.

Status:
Closed
Priority:
Should have
Category:
System/Bootstrap/Configuration
Start date:
2019-11-25
Due date:
% Done:

100%

TYPO3 Version:
10
PHP Version:
Tags:
Complexity:
Sprint Focus:

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.

Associated revisions

Revision 389fac2f (diff)
Added by Benjamin Franzke 6 months ago

[TASK] Use ArrayObject for middleware storage in symfony container

Symfony 4.4 deprecated support for non-object services:
https://github.com/symfony/dependency-injection/commit/6f11b359ab9

The usage of `array` as service is therefore no longer officially
supported in Symfony 5.0. It still works, but in order to make
sure that a possibly introduced type declaration in a 5.x release
doesnt causes a type error, we migrate the middleware service
from array to ArrayObject.

Change-Id: Ie544014b4aa0217b84b0c9d2cc69efde352bef27
Releases: master
Resolves: #89766
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/62429
Tested-by: Susanne Moog <>
Tested-by: TYPO3com <>
Tested-by: Andreas Fernandez <>
Reviewed-by: Susanne Moog <>
Reviewed-by: Andreas Fernandez <>

History

#1 Updated by Gerrit Code Review 6 months ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/62429

#2 Updated by Gerrit Code Review 6 months ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/62429

#3 Updated by Benjamin Franzke 6 months ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#4 Updated by Benni Mack 6 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF