Skip to content

[New Rule] Static methods SHOULD NOT be used #24

Closed
@lenaorobei

Description

@lenaorobei

Rule

The use of static methods is discouraged.

Reason

Source: Magento Technical Guidelines.

Plugins cannot be used with static methods, because static methods cannot be intercepted.
As a result, It hurts extensibility.

Implementation

  • Subscribe to the T_STATIC token.
  • If T_FUNCTION is found right to it raise a warning.

Metadata

Metadata

Assignees

Labels

Progress: good first issueIssues is easy to get started withacceptedNew rule is acceptednew ruleNew feature implementationtechnical guidelinesThe rule is based on Magento Technical Guidelines

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions