Open Cambis opened 1 year ago
This can be achieved with PHPStan
For reference here's a module that can currenlty achieve this https://github.com/silverleague/silverstripe-ideannotator/tree/master, it is a silverstripe module that runs on dev/build
We could achieve this using rector, which would have the added advantage of not running on dev/build
This would be risky. dev/build
is not for changing codebase :)
For reference here's a module that can currenlty achieve this https://github.com/silverleague/silverstripe-ideannotator/tree/master, it is a silverstripe module that runs on dev/build
We could achieve this using rector, which would have the added advantage of not running on dev/build
Yeah not keen on the whole dev/build thing 🙅 , just noting the package there for inspiration 💡
Would be a fun feature to add to kendo templates, definitely possible with minimal logic. It would really help dispel some of the magic around DataObjects ✨🧙
Maintaining it would be a bit hit and miss without some kind of automation though
FYI there's a rule for validating @method Baz Baz()
(and other @method
annotations for relations) in the new https://github.com/silverstripe/silverstripe-standards (only compatible with framework 5.2+, due to its reliance on generics which are added in that release - coming in April this year)
Dynamic property annotations for static config
PHP version:
8.1
Proposed Sniff name:
Silverstripe.Sniffs.Commenting.DynamicPropertySniff
The idea for this sniff is to enforce magic property annotations for static config array fields ($db, $has_one, $extensions etc).
Reason for proposed change
Disallowed Code Example
Allowed Code Example