[wp-trac] [WordPress Trac] #53978: Non-static method 'get_default_primary_column_name' should not be called statically

WordPress Trac noreply at wordpress.org
Thu Feb 10 16:24:06 UTC 2022


#53978: Non-static method 'get_default_primary_column_name' should not be called
statically
---------------------------+-----------------------------------------------
 Reporter:                 |       Owner:  (none)
  volodymyrkolesnykov      |
     Type:  defect (bug)   |      Status:  closed
 Priority:  normal         |   Milestone:
Component:                 |     Version:  4.3
  Administration           |
 Severity:  normal         |  Resolution:  invalid
 Keywords:  dev-feedback   |     Focuses:  administration, coding-standards
---------------------------+-----------------------------------------------
Changes (by jrf):

 * status:  reopened => closed
 * resolution:   => invalid


Comment:

 I think there is a misconception here - using `self::`, `parent::` or
 `static::` for a method call does NOT make it a static method call.
 Calling a method using these keywords is about scope resolution in a class
 hierarchy, not about whether a method is declared as `static` or not.

 It would be a static call if the method was called like so:
 `WP_List_Table::get_default_primary_column_name()`

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


More information about the wp-trac mailing list