|
| 1 | +# Contributing to Station Example |
| 2 | + |
| 3 | +Thank you for your interest in contributing to the Station Example application! This document provides guidelines and instructions for contributing. |
| 4 | + |
| 5 | +## Requirements |
| 6 | + |
| 7 | +- **PHP 8.3+** (8.4 recommended) |
| 8 | +- **Laravel 12.x** |
| 9 | +- **Docker** (for development environment) |
| 10 | + |
| 11 | +## Development Environment Setup |
| 12 | + |
| 13 | +### 1. Clone and Install |
| 14 | + |
| 15 | +```bash |
| 16 | +git clone https://github.com/ojbaeza/station-example.git |
| 17 | +cd station-example |
| 18 | +composer install |
| 19 | +``` |
| 20 | + |
| 21 | +### 2. Start Docker Services |
| 22 | + |
| 23 | +```bash |
| 24 | +docker compose up -d |
| 25 | +``` |
| 26 | + |
| 27 | +### 3. Verify Setup |
| 28 | + |
| 29 | +```bash |
| 30 | +docker exec station_example sh -c "XDEBUG_MODE=off php artisan test" |
| 31 | +``` |
| 32 | + |
| 33 | +## Code Style |
| 34 | + |
| 35 | +This project follows **PER-CS 3.0** coding standards. |
| 36 | + |
| 37 | +### Fixing Code Style |
| 38 | + |
| 39 | +```bash |
| 40 | +composer cs-fix |
| 41 | +``` |
| 42 | + |
| 43 | +**Note:** Do not use Laravel Pint. Use `composer cs-fix` (PHP-CS-Fixer) instead. |
| 44 | + |
| 45 | +## Static Analysis |
| 46 | + |
| 47 | +Station Example uses **PHPStan at level 8** with Larastan for Laravel-specific rules. |
| 48 | + |
| 49 | +```bash |
| 50 | +docker exec station_example sh -c "XDEBUG_MODE=off php vendor/bin/phpstan analyse --memory-limit=512M" |
| 51 | +``` |
| 52 | + |
| 53 | +## Testing |
| 54 | + |
| 55 | +### Running Tests |
| 56 | + |
| 57 | +```bash |
| 58 | +# All tests |
| 59 | +docker exec station_example sh -c "XDEBUG_MODE=off php artisan test" |
| 60 | + |
| 61 | +# Specific test |
| 62 | +docker exec station_example sh -c "XDEBUG_MODE=off php artisan test --filter TestClassName" |
| 63 | +``` |
| 64 | + |
| 65 | +### Test Naming Convention |
| 66 | + |
| 67 | +Use camelCase pattern: `test{Feature}{Scenario}{ExpectedResult}` |
| 68 | + |
| 69 | +```php |
| 70 | +public function testDispatchWithValidJobReturnsJobId(): void |
| 71 | +public function testRecoveryWithStuckJobResumesSuccessfully(): void |
| 72 | +``` |
| 73 | + |
| 74 | +## Pull Request Process |
| 75 | + |
| 76 | +### Before Submitting |
| 77 | + |
| 78 | +1. **Create a feature branch** from `main` |
| 79 | +2. **Write tests** for your changes |
| 80 | +3. **Ensure all checks pass:** |
| 81 | + ```bash |
| 82 | + composer cs-fix |
| 83 | + docker exec station_example sh -c "XDEBUG_MODE=off php vendor/bin/phpstan analyse --memory-limit=512M" |
| 84 | + docker exec station_example sh -c "XDEBUG_MODE=off php artisan test" |
| 85 | + ``` |
| 86 | + |
| 87 | +### Submitting |
| 88 | + |
| 89 | +1. Push your branch to your fork |
| 90 | +2. Open a Pull Request against `main` |
| 91 | +3. Wait for CI checks to pass |
| 92 | + |
| 93 | +### PR Guidelines |
| 94 | + |
| 95 | +- Keep PRs focused and reasonably sized |
| 96 | +- One feature or fix per PR |
| 97 | +- Write clear commit messages |
| 98 | +- Reference related issues |
| 99 | + |
| 100 | +## Getting Help |
| 101 | + |
| 102 | +- **Questions:** Open a GitHub Discussion |
| 103 | +- **Bug Reports:** Open a GitHub Issue with reproduction steps |
| 104 | +- **Station Package:** See [ojbaeza/station](https://github.com/ojbaeza/station) |
| 105 | + |
| 106 | +## Code of Conduct |
| 107 | + |
| 108 | +This project follows our [Code of Conduct](CODE_OF_CONDUCT.md). By participating, you agree to uphold this code. |
| 109 | + |
| 110 | +## License |
| 111 | + |
| 112 | +By contributing, you agree that your contributions will be licensed under the MIT License. |
0 commit comments