[wp-trac] [WordPress Trac] #37867: Document return types for create/create_and_get/create_many() methods of factory classes

WordPress Trac noreply at wordpress.org
Tue Aug 30 01:24:19 UTC 2016


#37867: Document return types for create/create_and_get/create_many() methods of
factory classes
------------------------------+------------------------------
 Reporter:  jdgrimes          |       Owner:
     Type:  enhancement       |      Status:  new
 Priority:  normal            |   Milestone:  Awaiting Review
Component:  Build/Test Tools  |     Version:  3.7
 Severity:  normal            |  Resolution:
 Keywords:  2nd-opinion       |     Focuses:  docs
------------------------------+------------------------------

Comment (by boonebgorges):

 The PHPDocumentation description for `@method` suggests that it's
 specifically for use in contexts where `__call()` is used on a parent
 class, so that there are no methods where the documentation could
 naturally appear. This isn't the case for `create()` and friends. I'm not
 sure how PhpStorm and similar IDEs handle this sort of thing, but it seems
 like they (or their users) should be able to traverse the inheritance tree
 for this sort of thing.

 Now, it so happens that the classes in question - `create_object()`,
 `update_object()`, `create()`, etc on `WP_UnitTest_Factory_For_Thing` - do
 not have any PHPDoc at all. I bet proper documentation of these would be
 enough to make your IDE document the child classes properly.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/37867#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list