Skip to content

What are the standards for writing interfaces and traits? #1327

@dingo-d

Description

@dingo-d

In the coding standards only the naming of the classes is covered here. So a class called Example_Class has to reside in a class-example-class.php file.

What should we use for interfaces and traits?

SomeInterface like in PSR-2 or Some_Interface or ISomeInterface with I as a prefix?

And what for traits? Also should the files that hold them have interface- or trait- prefix?

This could be a bit out of scope since WP is clinging to php 5.2, but just because core isn't implementing them, doesn't mean that the developers shouldn't, so it would be great to have some sort of unified guideline how to implement them.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions