Skip to content

[New Rule] Controllers Should Implement HTTP Method Marker Interface #34

Closed
@sprankhub

Description

@sprankhub

Rule

Controllers SHOULD implement one of the HTTP method marker interfaces like HttpPostActionInterface (see https://github.com/magento/magento2/tree/2.3/lib/internal/Magento/Framework/App/Action).

Reason

Source: Magento DevDocs About Routing

Implementation

Check for subclasses of \Magento\Framework\App\Action\AbstractAction or classes, which implement \Magento\Framework\App\ActionInterface and check if these classes also implement one of the marker interfaces.

Important Details

This sniff should be applicable to Magento >=2.3, because older versions of Magento do not have HTTP method marker interfaces.

Metadata

Metadata

Assignees

No one assigned

    Labels

    need to discussRule requires discussionnew ruleNew feature implementationproposalNew rule proposalversion specifiсRule is applicable to specific Magento version only

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions