- Follow PSR 0, 1, 2
- For gateways, use fetch, fetchBy, save, attach, detach and delete ex: fetchByEmail, saveChannel, deleteProduct, attachUser
- Fetch MUST include the noun on singular and All with fetching multiple ex: fetchProduct, fetchAllAccounts, fetchAllActiveUsers
- FetchBy MUST include the noun ex: fetchByEmail, fetchByName
- Save, delete, attach and detach MUST include the noun ex: attachUser, saveJob, detachAccount
- If you need to update part of an document, use the term update and the singular noun Good: updateUserPassword, updateProductPrice Bad: updateUsersPassword, saveNewProductPrice
- When Talking with 3rd party services, follow the rules for gateways however
- use import instead of fetch
- use send instead of save
- use remove instead of delete
- Abstract classes MUST HAVE the first word be "Abstract" ex: AbstractFooClass
- Interfaces MUST HAVE the last word be "Interface" ex: FooBarInterface
- Traits MUST HAVE the last word be "Trait" ex: FooBarTrait
- Events on object that will be series MUST be in the follow order: event.pre, event, event.post ex: saveUser.pre, saveUser, saveUser.post
Created
August 20, 2015 16:47
-
-
Save manchuck/20894bd8273c289a0250 to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment