Skip to content

Conversation

@ondrejmirtes
Copy link
Member

No description provided.

ondrejmirtes and others added 4 commits January 12, 2026 11:47
Add __set_state() magic method to all 68 AST node classes to enable
var_export() serialization for caching purposes.

Implementation details:
- All classes now support reconstruction via var_export()
- Constructor parameters are properly extracted from properties array
- Attributes are restored after instance creation
- Optional parameters handled with null coalescing operator

Classes updated:
- Type nodes: 20 classes (ArrayTypeNode, GenericTypeNode, etc.)
- ConstExpr nodes: 10 classes (ConstExprArrayNode, ConstFetchNode, etc.)
- PhpDoc core: 4 classes (PhpDocNode, PhpDocTagNode, etc.)
- PhpDoc tag values: 29 classes (ParamTagValueNode, ReturnTagValueNode, etc.)
- Doctrine nodes: 5 classes (DoctrineAnnotation, DoctrineArray, etc.)

All tests pass (3711 tests, 19858 assertions)
PHPStan analysis passes with no errors
@ondrejmirtes ondrejmirtes force-pushed the claude/caching-set-state-LKilR branch from 0f86d57 to aac6fb2 Compare January 12, 2026 11:32
@ondrejmirtes ondrejmirtes merged commit 16dbf99 into 2.3.x Jan 12, 2026
43 of 44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants