[wp-trac] [WordPress Trac] #44253: @return missing in doc comment of get_admin_page_parent function

WordPress Trac noreply at wordpress.org
Mon May 28 13:55:10 UTC 2018


#44253: @return missing in doc comment of get_admin_page_parent function
------------------------------+-----------------------------
 Reporter:  subrataemfluence  |      Owner:  (none)
     Type:  defect (bug)      |     Status:  new
 Priority:  normal            |  Milestone:  Awaiting Review
Component:  Plugins           |    Version:  trunk
 Severity:  normal            |   Keywords:  dev-feedback
  Focuses:  coding-standards  |
------------------------------+-----------------------------
 @return is missing in the Doc comment of get_admin_page_parent function.


 Also I have a question. At the end of the function body we are returning
 hard coded empty string i.e. `return ''`;

 Why don't we return the `$parent_file` instead? Since we are already
 returning the value from rest of the `if-else` blocks and `foreach` loop
 the last final  statement either will return an `empty` string or a value
 assigned to `$parent_file` variable.

 {{{#!php
 <?php
 if( empty( $parent_file ) ) {
    $parent_file = '';
 }

 return $parent_file;
 }}}

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


More information about the wp-trac mailing list