Skip to content

Add sniff for Service Contracts #159

Open
@kanduvisla

Description

@kanduvisla

Rule

According to this page there are some very specific rules for service contracts. For example:

  • Valid object types include a fully qualified class name or a fully qualified interface name.
  • Any parameters or return values of type array can be denoted by following any of the previous types by an empty set of square brackets []

Wouldn't it make sense to have a sniff for these things?

Reason

I come across a lot of service contracts that don't include FQCN and/or have an array return type instead of FQCN[]. This goes against the rules set by Magento and might also break future (web api) implementations (due to reflection).

Implementation

Not sure at this moment how to implement this, but it seems to me that this can be done with a new sniff.

Metadata

Metadata

Assignees

No one assigned

    Labels

    proposalNew rule proposal

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions