Skip to content

dependencySerializationTraitProperty.unsupportedPrivateProperty false positive for non-service properties #1025

Description

@travis-bradbury

Bug report

dependencySerializationTraitProperty.unsupportedPrivateProperty reports an issue for properties that aren't relevant to DependencySerializationTrait. See #1024 for an example.

DependencySerializationTrait only looks at properties that are objects and services (by looking up the service ID from the value) https://git.drupalcode.org/project/drupal/-/blob/main/core/lib/Drupal/Core/DependencyInjection/DependencySerializationTrait.php#L39. A property that's a scalar value (eg, bool) is trivially serializable and is ignored by the trait, but it reported by dependencySerializationTraitProperty.unsupportedPrivateProperty.

Code snippet that reproduces the problem

Example 7c0932e.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions