You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Allow dynamic properties (e.g. endLineno) without deprecation notice in ast\Node (#217)
(But use the default deprecation behavior for ast\Metadata)
1. php-ast itself sets the dynamic property on endLineno right now,
causing deprecation notices in PHP 8.2.
Because all declaration types are associative arrays(not lists),
a future AST version number may add this as a property of
$node->children instead to avoid this notice.
2. WeakMap is only available in PHP 8.0+ (and WeakReference 7.4),
but https://github.com/phan/phan targets PHP 7.2+.
3. Because some nodes make `$node->children` a list,
applications such as Phan using php-ast can't associate string keys
with that.
(e.g. to mark nodes that were already processed in a certain step)
https://github.com/nikic/php-parser solves that by adding
`attributes`, `setAttribute`, `getAttribute`, etc. separately from
children, but php-ast currently doesn't have an attributes node.
That may be worth it in a future release.
4. When processing a large number of ast nodes in a large number of
files, the deprecation notices have a noticeable performance impact,
even when suppressed.
Related to #214
0 commit comments