Skip to content

Support nested attributes introduced in PHP 8.1 #36

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 18, 2025

Conversation

olvlvl
Copy link
Owner

@olvlvl olvlvl commented Jun 12, 2025

Nested attributes introduced in PHP 8.1 are not supported at the moment. Because the attribute arguments are exported with var_export(), nested attributes need to implement __set_state, otherwise, reading the attributes will result in an error, as reported by #28.

Proposed solution

To support nested attributes, attribute arguments should be serialized instead of exported.

@olvlvl olvlvl added the enhancement New feature or request label Jun 12, 2025
@olvlvl olvlvl added this to the v2.1.0 milestone Jun 12, 2025
@olvlvl olvlvl force-pushed the main-use-serialization branch from a925621 to 119f17b Compare June 12, 2025 10:12
@olvlvl olvlvl self-assigned this Jun 12, 2025
@olvlvl olvlvl force-pushed the main-use-serialization branch from 119f17b to f4b1965 Compare June 17, 2025 11:28
@olvlvl olvlvl changed the base branch from main to 2.2 June 17, 2025 11:29
@olvlvl olvlvl modified the milestones: v2.1.0, v2.2.0 Jun 17, 2025
@olvlvl olvlvl force-pushed the main-use-serialization branch from f4b1965 to d3ffab5 Compare June 17, 2025 11:34
@coveralls
Copy link

coveralls commented Jun 17, 2025

Pull Request Test Coverage Report for Build 15706106380

Details

  • 5 of 5 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 92.0%

Totals Coverage Status
Change from base Build 15705999548: 0.0%
Covered Lines: 437
Relevant Lines: 475

💛 - Coveralls

@olvlvl olvlvl force-pushed the main-use-serialization branch from d3ffab5 to 1333cc8 Compare June 17, 2025 22:56
@olvlvl olvlvl changed the base branch from 2.2 to main June 17, 2025 23:00
@olvlvl olvlvl changed the base branch from main to 2.2 June 17, 2025 23:00
@olvlvl olvlvl force-pushed the main-use-serialization branch 2 times, most recently from 1eb9989 to f879cc4 Compare June 18, 2025 10:47
@olvlvl olvlvl changed the base branch from 2.2 to main June 18, 2025 10:47
@olvlvl olvlvl force-pushed the main-use-serialization branch 3 times, most recently from 0d64e37 to 6e954f3 Compare June 18, 2025 13:12
@olvlvl olvlvl changed the base branch from main to 2.2 June 18, 2025 13:12
to support nested attributes
@olvlvl olvlvl force-pushed the main-use-serialization branch from 6e954f3 to d488c8d Compare June 18, 2025 13:18
@olvlvl olvlvl merged commit 3f8e5d2 into 2.2 Jun 18, 2025
20 checks passed
@olvlvl olvlvl deleted the main-use-serialization branch June 18, 2025 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants