|
| 1 | +# Contributing |
| 2 | + |
| 3 | +> [!IMPORTANT] |
| 4 | +> **Important Note on Major Changes** |
| 5 | +> For substantial changes or new features that significantly alter the codebase, please discuss your proposed changes with the project maintainer or lead developer before submitting your pull request. This ensures alignment with the project's roadmap and helps avoid potential conflicts. |
| 6 | +
|
| 7 | +We appreciate your interest in contributing to this project! To ensure a smooth process, please follow these steps: |
| 8 | + |
| 9 | +1. **Fork the repository**: |
| 10 | + |
| 11 | + Create your own copy of the repository on GitHub. |
| 12 | + |
| 13 | +2. **Create a feature branch**: |
| 14 | + |
| 15 | + Create a new branch for each feature or bug fix with a descriptive name. This helps to keep your work organized and separate from the main codebase. |
| 16 | + |
| 17 | + ```bash |
| 18 | + $ git checkout -b feature/your-feature-name |
| 19 | + ``` |
| 20 | + |
| 21 | +3. **Write tests**: |
| 22 | + |
| 23 | + Ensure that any changes you make are covered by appropriate tests. This includes unit tests for new features and updates to existing tests where applicable. |
| 24 | + |
| 25 | +4. **Run Tests**: |
| 26 | + |
| 27 | + Before submitting your changes, ensure all tests pass by running the test suite. |
| 28 | + |
| 29 | + ```bash |
| 30 | + $ composer test |
| 31 | + ``` |
| 32 | + |
| 33 | +5. **Follow coding standards**: |
| 34 | + |
| 35 | + Adhere to the project’s coding standards. We use PSR-12 coding style. You can automatically fix your code using the following commands: |
| 36 | + |
| 37 | + - [**PSR-12 Coding Standard**][1] |
| 38 | + The easiest way to apply the conventions is to install [PHP Code Sniffer][2]. |
| 39 | + |
| 40 | + - To check for code style issues without fixing them: |
| 41 | + |
| 42 | + ```bash |
| 43 | + $ composer cs-check |
| 44 | + ``` |
| 45 | + |
| 46 | + - To fix code style issues: |
| 47 | + |
| 48 | + ```bash |
| 49 | + $ composer cs-fix |
| 50 | + ``` |
| 51 | + |
| 52 | + Ensure that your code is well-documented with clear comments explaining the functionality where necessary. |
| 53 | + |
| 54 | + |
| 55 | +6. **Commit Your Changes**: |
| 56 | + |
| 57 | + Write clear and concise commit messages that explain your changes. |
| 58 | + |
| 59 | + ```bash |
| 60 | + $ git commit -m "Add feature X to improve Y" |
| 61 | + ``` |
| 62 | + |
| 63 | +7. **Push Your Branch**: |
| 64 | + |
| 65 | + Push your branch to your forked repository: |
| 66 | + |
| 67 | + ```bash |
| 68 | + $ git push origin feature/your-feature-name |
| 69 | + ``` |
| 70 | +8. **Submit a Pull Request**: |
| 71 | + |
| 72 | + Go to the original repository on GitHub and click "New Pull Request". Provide a clear description of the changes and why they are necessary. Link any related issues if applicable. |
| 73 | + |
| 74 | + > [!IMPORTANT] |
| 75 | + > Mention any specific tests that need to be reviewed. |
| 76 | + |
| 77 | +We warmly welcome all contributions and are thankful for your efforts to improve this project. |
| 78 | + |
| 79 | +**Happy coding**! |
| 80 | + |
| 81 | +[1]: <https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-12-extended-coding-style-guide.md> |
| 82 | +[2]: <http://pear.php.net/package/PHP_CodeSniffer> |
0 commit comments