Bug report
(Now that all Entity Query problems seem to be solved, I looked a bit closer at the Trusted Callbacks, so expect some more issues on that)
Currently \mglaman\PHPStanDrupal\Rules\Drupal\RenderCallbackRule only checks if the class implements TrustedCallbackInterface.
However the callbacks should also be in the return array from trustedCallbacks() to be trusted.
Now I highly doubt that people "in the wild" go through the trouble of creating callbacks and making sure the containing class implements TrustedCallbackInterface and finally don't add the callback to trustedCallbacks(), so the impact seems low.
However what we're currently doing seems incorrect.
Code snippet that reproduces the problem
See testcases in (extended) tests/src/Rules/data/bug-543.php
Bug report
(Now that all Entity Query problems seem to be solved, I looked a bit closer at the Trusted Callbacks, so expect some more issues on that)
Currently
\mglaman\PHPStanDrupal\Rules\Drupal\RenderCallbackRuleonly checks if the class implementsTrustedCallbackInterface.However the callbacks should also be in the return array from
trustedCallbacks()to be trusted.Now I highly doubt that people "in the wild" go through the trouble of creating callbacks and making sure the containing class implements
TrustedCallbackInterfaceand finally don't add the callback totrustedCallbacks(), so the impact seems low.However what we're currently doing seems incorrect.
Code snippet that reproduces the problem
See testcases in (extended)
tests/src/Rules/data/bug-543.php