Coding-standard: Static closures not compatible with Closure::bind()

Created on 24 Sep 2018  路  3Comments  路  Source: slevomat/coding-standard

BetterReflection uses closure binding to access object properties. Static closures cannot be bound to an object at all.
https://github.com/Roave/BetterReflection/blob/ffe74cae76a35d09cdc913fda5390a6317d170f6/src/Reflection/ReflectionProperty.php#L370-L372

This is probably impossible to fix in a generic way (would require static analysis), but preventing Closure::bind(static function () ... {}, ...) should be doable.

Bug

Most helpful comment

Heh, I wrote this code in BR 馃槃

All 3 comments

Heh, I wrote this code in BR 馃槃

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings