[wp-trac] [WordPress Trac] #44411: Add property doc in child class

WordPress Trac noreply at wordpress.org
Wed Jun 20 12:00:56 UTC 2018


#44411: Add property doc in child class
------------------------------+-----------------------------
 Reporter:  subrataemfluence  |      Owner:  (none)
     Type:  enhancement       |     Status:  new
 Priority:  normal            |  Milestone:  Awaiting Review
Component:  General           |    Version:  trunk
 Severity:  normal            |   Keywords:  2nd-opinion
  Focuses:  coding-standards  |
------------------------------+-----------------------------
 There are few classes where doc comments are missing for public property
 declaration.

 Examples:

 {{{#!php
 <?php
 class WP_Customize_Image_Control extends WP_Customize_Upload_Control {
   public $type      = 'image';
   public $mime_type = 'image';
   ...
 }
 }}}


 The above class extends `WP_Customize_Upload_Control`:

 {{{#!php
 <?php
 class WP_Customize_Upload_Control extends WP_Customize_Media_Control {
   public $type          = 'upload';
   public $mime_type     = '';
   public $button_labels = array();
   public $removed       = ''; // unused
   public $context; // unused
   public $extensions = array(); // unused
   ...
 }
 }}}


 Although the properties are documented in `WP_Customize_Media_Control`, it
 would be good to have them documented inside the scope of each class also.
 Otherwise one has to navigate to the class which it extends to read the
 actual documentation. Some cases like the one above could have a multi-
 level navigation.

 Is this worth doing for the sake of better code readability?

 Related #44410

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/44411>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list