Skip to content

Conversation

@GromNaN
Copy link
Member

@GromNaN GromNaN commented Jan 7, 2026

Q A
Bug fix? yes
New feature? no
Deprecations? no
Documentation? no
Issues -
License MIT

The method SplObjectStorage::attach is deprecated in PHP 8.5.

I refactored the method to avoid dynamic property access, which should help the static analysis.

@carsonbot carsonbot added Bug Bug Fix Turbo Status: Needs Review Needs to be reviewed labels Jan 7, 2026
@GromNaN GromNaN changed the title [Turbo] Replace SplObjectStorage::attach with array access in Doctrine Broadcast listener [Turbo] Fix SplObjectStorage::attach deprecation in Doctrine Broadcast listener Jan 7, 2026

if ($options = $this->broadcastedClasses[$class]) {
if ('createdEntities' !== $property) {
if ($this->createdEntities !== $objectStorage) {
Copy link
Member Author

@GromNaN GromNaN Jan 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using object identity instead of string comparison. The object in $this->createdEntities can't be replaced after it's passed to call storeEntitiesToPublish.

@GromNaN GromNaN force-pushed the php85-objectstorage-attach branch 2 times, most recently from 3705ed9 to f2d05fd Compare January 7, 2026 20:48
@GromNaN
Copy link
Member Author

GromNaN commented Jan 7, 2026

PHP 8.4 issue related to symfony/panther#688

@Kocal
Copy link
Member

Kocal commented Jan 7, 2026

Other checks are failing (e.g. https://github.com/symfony/ux/actions/runs/20796034910/job/59729700255?pr=3273) but that's not related to your PR, I didn't have time to investigate yet (help welcome 🙏🏻 )

@carsonbot carsonbot added Status: Reviewed Has been reviewed by a maintainer and removed Status: Needs Review Needs to be reviewed labels Jan 7, 2026
Copy link
Member

@smnandre smnandre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

…t listener

The method is deprecated in PHP 8.5

Also refactor to avoid dynamic property access and help static analysis
@GromNaN GromNaN force-pushed the php85-objectstorage-attach branch from f2d05fd to de466ce Compare January 8, 2026 08:07
@Kocal
Copy link
Member

Kocal commented Jan 8, 2026

You can also ignore "Functional Tests" jobs, IIRC they are flakies, sometimes they work, sometimes they don't. We need to take time to investigate

@Kocal
Copy link
Member

Kocal commented Jan 8, 2026

Thank you @GromNaN.

@Kocal Kocal merged commit df8d2e5 into symfony:2.x Jan 8, 2026
28 of 37 checks passed
@GromNaN GromNaN deleted the php85-objectstorage-attach branch January 8, 2026 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Bug Fix Status: Reviewed Has been reviewed by a maintainer Turbo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants