Skip to content

Development Setup

  1. Install Dependencies:

    composer install
    

  2. Start Development Environment (if using Docker):

    composer server:start
    

  3. Run Tests to ensure everything is working:

    composer test
    

  4. Check Code Standards:

    composer cs
    composer stan
    

Code Style and Standards

Automated Checks

Before submitting your PR, ensure all checks pass:

# Check code style
composer cs

# Fix code style automatically
composer cs:fix

# Run static analysis
composer stan

# Run all checks
composer check

Manual Standards

  1. Variable Naming: Use descriptive names
  2. Good: $clientIpAddress, $rateLimitWindow
  3. Bad: $ip, $rlw

  4. Method Length: Keep methods focused and short (under 20 lines when possible)

  5. Class Responsibility: Follow Single Responsibility Principle

  6. Error Handling: Always handle edge cases and potential errors