-
Notifications
You must be signed in to change notification settings - Fork 823
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create phpDoc @method for "create" on all Injectables #8660
Comments
Didn't know that worked, good stuff! Do you want to do a PR for core modules on this? There's a module out there which auto-adds some PHPDoc to custom SilverStripe code (e.g. getters for I don't think anyone will object to doing this, but it's unlikely to be actioned by the core team. So I'll put a |
Adds to list of hackday ideas |
Related issue thread on the IDE annotator module: silverleague/silverstripe-ideannotator#113 |
Looks like chillu forgot to close this. It's a good idea but I don't think having an issue open for this is useful. |
Any classes implementing
Injectable
should have a@method
phpDoc annotation for thecreate
method to have a better experience in IDEs. Because right now, it just says "any number of arguments".Example for
SilverStripe\Forms\TextField
:The signatures are taken from the constructors and their phpDoc annotations. This way, you get the exact same IDE help for the
::create()
method as for the constructor, which can make the adoption of the Factory method easier.Technically, it could be possible to automate this across all files with some script, but I'm not sure that would be faster than manually doing it... Depends on how many classes actually use Injectable, I guess. If some modules do as well, it might be useful to write such a script.
The text was updated successfully, but these errors were encountered: