Skip to content

Remove usage of $node->getAttribute('parent') to be compatible with PHPStan 1.6.0+ #399

@mglaman

Description

@mglaman

PHPStan added a bunch of memory improvements. One of them is done by no longer providing attributes to the parents, siblings, etc. Read more at https://phpstan.org/blog/phpstan-1-6-0-with-conditional-return-types

This breaks a check done in RenderCallbackRule. This performs checks to see if the caller is in array_intersect_key as done in \Drupal\Core\Render\Renderer::doRender. This is used to strip out lazy builder information.

One fix is to allow boolean values under the assumption it is for array_intersect_key. Or to follow this blog https://phpstan.org/blog/preprocessing-ast-for-custom-rules and add a custom traverser.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions