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.unsupportedPrivatePropertyoccurrences in core. - Regenerate
core/.phpstan-baseline.php. - Verify PHPStan passes in GitLab CI.
User interface changes
None.
API changes
None.
Data model changes
None.
| Comment | File | Size | Author |
|---|
Issue fork drupal-3642135
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
Comment #3
mallezieMR 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.
Comment #4
needs-review-queue-bot commentedThe 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.
Comment #5
mallezieComment #6
mallezieComment #7
mstrelan commentedLeft one comment on the MR
Comment #8
mallezieRebased, and removed the unused properties.