Skip to content

Latest commit

 

History

History
61 lines (40 loc) · 1.95 KB

CODING_GUIDELINES.md

File metadata and controls

61 lines (40 loc) · 1.95 KB

Coding Guidelines

These coding guidelines are intended to ensure a consistent and maintainable codebase for FunnyQuoteLib. All contributors are expected to follow these guidelines when submitting code changes.

General Guidelines

  • Readability:

    • Write clear and readable code. Use meaningful variable and function names.
    • Keep lines of code reasonably short to enhance readability.
  • Consistency:

    • Follow consistent coding patterns and conventions.
    • Use consistent indentation (spaces or tabs) throughout the codebase.
  • Comments:

    • Add comments to explain complex or non-intuitive sections of code.
    • Ensure comments are kept up-to-date with code changes.

PHP Guidelines

  • PSR Standards:

    • Follow the PSR-1 and PSR-2 standards as much as possible.
    • For autoloading, adhere to PSR-4.
  • Namespace:

    • Use namespaces to organize classes logically.
  • Class Structure:

    • Follow a consistent class structure: properties, constructor, methods.
  • Error Handling:

    • Use exceptions for error handling rather than PHP errors.

Testing Guidelines

  • Unit Tests:

    • Write comprehensive unit tests for new features and bug fixes.
    • Ensure existing tests pass before submitting changes.
  • Test Coverage:

    • Aim for high test coverage to catch regressions.

Pull Requests

  • One Feature or Bug Fix Per Pull Request:

    • Keep pull requests focused on addressing a single issue or implementing a specific feature.
  • Clear Descriptions:

    • Provide a clear and concise description of the changes made in the pull request.
  • Reference Issues:

    • If applicable, reference the relevant issue(s) in your pull request.

Versioning

  • Semantic Versioning:
    • Follow semantic versioning (SemVer) for versioning.

Attribution

By contributing to FunnyQuoteLib, you agree to adhere to these coding guidelines. Consistent adherence to these guidelines will help maintain a high-quality and cohesive codebase.