33 lines
1.2 KiB
Markdown
33 lines
1.2 KiB
Markdown
# Contributing
|
|
|
|
## PHP Code
|
|
- Two spaces indentation.
|
|
- CamelCase for classes.
|
|
- camelCase for methods.
|
|
- snake_case for variables and class properties.
|
|
- Composition over Inheritance.
|
|
- Comments are a code smell. If you need to use a comment - see if same idea can be achieved by more clearly expressing code.
|
|
- Require other classes with 'use' at the beginning of the class file.
|
|
- Do not specify 'public' if method is public, it's implicit.
|
|
- Always use guard clauses.
|
|
- Ensure compatibility with PHP 5.5 and newer versions.
|
|
- Cover your code in tests.
|
|
|
|
## JS Code
|
|
- Javascript code should follow the [Airbnb style guide](https://github.com/airbnb/javascript).
|
|
|
|
## Git flow
|
|
- Do not commit to master.
|
|
- Open a short-living feature branch.
|
|
- Open a pull request.
|
|
- Add Jira issue reference in the title of the Pull Request.
|
|
- Work on the pull request.
|
|
- Use the `./do qa` command to check your code style before pushing.
|
|
- Use good commit messages as explained here https://chris.beams.io/posts/git-commit
|
|
- Wait for review from another developer.
|
|
|
|
## Issues creation
|
|
- Issues are managed on Jira.
|
|
- Discuss issues on public Slack chats, discuss code in pull requests.
|
|
- Open a small Jira issue only when it has been discussed.
|