Issue summary generated with the help of an LLM.

Problem/Motivation

PHPStan currently flags several dependencySerializationTraitProperty.unsupportedPrivateProperty errors across Drupal core where a serializable class has private properties.

Properties on serializable classes should not be private as this can cause problems when they are serialized on the container.

Those are candidates for easy fixes, and also remove some related issues from the baseline automatically.

Proposed resolution

Use protected or public properties.

Remaining tasks

  • Fix all dependencySerializationTraitProperty.unsupportedPrivateProperty occurrences in core.
  • Regenerate core/.phpstan-baseline.php.
  • Verify PHPStan passes in GitLab CI.

User interface changes

None.

API changes

None.

Data model changes

None.

Issue fork drupal-3642135

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mallezie created an issue. See original summary.

mallezie’s picture

Status: Active » Needs review

MR created.

One notable change in core/lib/Drupal/Core/Entity/EntityStorageBase.php
This was marked private on purpose, i've changed this to be readonly to have the same result, but not cause serialization errors.

needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new1.05 KB

The Needs Review Queue Bot tested this issue. It fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

mallezie’s picture

Status: Needs work » Needs review
mallezie’s picture

mstrelan’s picture

Status: Needs review » Needs work

Left one comment on the MR

mallezie’s picture

Status: Needs work » Needs review

Rebased, and removed the unused properties.