Skip to content
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

Add the possibility to deprecate attributes and nodes on Node #4182

Merged
merged 1 commit into from
Aug 8, 2024

Conversation

fabpot
Copy link
Contributor

@fabpot fabpot commented Aug 8, 2024

No description provided.

@stof
Copy link
Member

stof commented Aug 8, 2024

How does deprecating a node interacts with node visitors ?

@fabpot
Copy link
Contributor Author

fabpot commented Aug 8, 2024

How does deprecating a node interacts with node visitors ?

That's the main use case for me: you get deprecations as node visitors call setAttribute()/setNode().

@fabpot fabpot force-pushed the attribute-node-deprecations branch from 446eb48 to 2871620 Compare August 8, 2024 10:07
@stof
Copy link
Member

stof commented Aug 8, 2024

OK, NodeTraverser calls `setNode only when the visitor returns a different node. So this should be fine in most cases.

@fabpot fabpot force-pushed the attribute-node-deprecations branch 3 times, most recently from 0ba38da to 0be9343 Compare August 8, 2024 10:40
@fabpot
Copy link
Contributor Author

fabpot commented Aug 8, 2024

New implementation with the possibility to customize the package and the version in addition to a new name (all optional).

@fabpot fabpot force-pushed the attribute-node-deprecations branch from 0be9343 to 349e88e Compare August 8, 2024 10:42
src/Node/Node.php Outdated Show resolved Hide resolved
@fabpot fabpot force-pushed the attribute-node-deprecations branch from 349e88e to 639d1ee Compare August 8, 2024 11:23
src/Node/Node.php Outdated Show resolved Hide resolved
src/Node/Node.php Outdated Show resolved Hide resolved
@fabpot fabpot force-pushed the attribute-node-deprecations branch 3 times, most recently from bf3b7ab to 1157112 Compare August 8, 2024 12:41
@fabpot fabpot force-pushed the attribute-node-deprecations branch from 1157112 to 18894cf Compare August 8, 2024 12:48
@fabpot fabpot merged commit 0d524d3 into twigphp:3.x Aug 8, 2024
1 check was pending
@fabpot fabpot deleted the attribute-node-deprecations branch August 8, 2024 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants