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.