Skip to content

Commit 7124b64

Browse files
Merge pull request #24 from WordPress/naming-conventions
Adds naming conventions to contributing doc
2 parents 980d178 + abff4a9 commit 7124b64

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

CONTRIBUTING.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,16 @@ While this project is stewarded by [WordPress AI Team](https://make.wordpress.or
88

99
All parameters, return values, and properties must use explicit type hints, except in cases where providing the correct type hint would be impossible given limitations of the oldest supported PHP version (see below).
1010

11+
## Naming conventions
12+
13+
The following naming conventions must be followed for consistency and autoloading:
14+
15+
- Interfaces are suffixed with `Interface`.
16+
- Traits are suffixed with `Trait`.
17+
- Enums are suffixed with `Enum`.
18+
- File names are the same as the class, trait, and interface name for PSR-4 autoloading.
19+
- Classes, interfaces, and traits, and namespaces are not prefixed with `Ai`, exluding the root namespace.
20+
1121
## PHP Compatibility
1222

1323
All code must be backward compatible with PHP 7.4, which is the minimum required PHP version for this project.

0 commit comments

Comments
 (0)