-
Notifications
You must be signed in to change notification settings - Fork 2
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
Add @method
PHPDoc annotations for relations
#163
Labels
Comments
GuySartorelli
changed the title
Add
Add Nov 23, 2023
@method
PHPDoc annotations for relation lists@method
PHPDoc annotations for relations
|
4 tasks
Have added just one PR to framework for peer review for now, if this is OK will do all the other modules on sink |
This was referenced Dec 14, 2023
This was referenced Dec 14, 2023
All linked PRs merged |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently there are no
@method
annotations for most relations in the Silverstripe CMS codebase. This means there is nothing telling developers which methods they can call to get those lists of relations, let alone what the type of list and items are for those relations. Developers have to refer to the source code to see what relations exist, and for which classes.We should add
@method
annotations for all relations added on classes.Member
already has some of these as an example.We should add these using an automated tool, and add a CI component to validate that they are present. That way, as new relations are added, we will see if we've forgotten to add the
@method
annotations through failed CI jobs, and be able to add them at the time the new relation is added.Related
Acceptance criteria
@method
annotations are added to class PHPDoc comments for all relations directly added on that classhas_one
,has_many
,many_many
)@method
annotations, including generics (e.g.ManyManyList<SiteTree>
for a non-through typemany_many
toSiteTree
, orImage
for ahas_one
toImage
)@method
annotation is added to the extension class's PHPDocMissing@method
annotations are picked up by CI (e.g. using phpstan or psalm)Extra@method
annotations that don't relate to anything on the class are picked up by CI (e.g. using phpstan or psalm)Update PHP Codding standards to mentioned@method
annotation.Notes
@method
annotations automagically.New issues created
Code writer
PRs
MNT Update @methods on class docblocks silverstripe-framework#11092The text was updated successfully, but these errors were encountered: