Open Skarvion opened 2 weeks ago
Agreed that a rule (or rules) to enforce "class constants/variables/methods should be referenced statically" would be useful.
Class methods can be polymorphic, so we should probably exclude virtual class methods from the rule.
Prerequisites
Suggested rule title
Class method should not be invoked from an object instance
Rule description
Calling a class method from an object instance would mislead reader that the method is an object method and may affect the object itself. Call class method using class name as prefix.
Rationale