Skip to content

Latest commit

 

History

History
129 lines (96 loc) · 3.46 KB

File metadata and controls

129 lines (96 loc) · 3.46 KB

Contributing to Klime PHP SDK

Thank you for your interest in contributing to the Klime PHP SDK!

Important: Repository Structure

This repository is a read-only mirror of our internal monorepo. We develop and maintain the SDK internally, then mirror releases to this public repository.

What This Means for Contributors

  • Pull requests are welcome and will be reviewed by our team
  • If accepted, we'll manually port your changes to our internal monorepo
  • Your changes will appear in this repository with the next release
  • You'll be credited as a co-author in the commit

How to Contribute

Reporting Bugs

  1. Check if the bug has already been reported in Issues
  2. If not, create a new issue with:
    • A clear, descriptive title
    • Steps to reproduce the bug
    • Expected vs actual behavior
    • Your environment (PHP version, OS, etc.)
    • Any relevant code snippets or error messages

Suggesting Features

  1. Check if the feature has already been suggested in Issues
  2. Create a new issue describing:
    • The problem you're trying to solve
    • Your proposed solution
    • Any alternatives you've considered

Submitting Code Changes

  1. Fork this repository
  2. Create a feature branch (git checkout -b feat/amazing-feature)
  3. Make your changes
  4. Write or update tests as needed
  5. Ensure all tests pass (composer test)
  6. Commit using Conventional Commits:
    feat: add new tracking method
    fix: handle edge case in batch processing
    docs: update README examples
    
  7. Push to your fork and open a Pull Request

Pull Request Guidelines

  • Provide a clear description of what the PR does
  • Reference any related issues
  • Include tests for new functionality
  • Update documentation if needed
  • Keep PRs focused - one feature or fix per PR

Development Setup

# Clone your fork
git clone https://github.com/YOUR_USERNAME/klime-php.git
cd klime-php

# Install dependencies
composer install

# Run tests
composer test

# Or run PHPUnit directly
vendor/bin/phpunit --testdox

Project Structure

klime-php/
├── src/
│   ├── Client.php              # Main client implementation
│   ├── Event.php               # Event class
│   ├── EventType.php           # Event type constants
│   ├── EventContext.php        # Event context
│   ├── LibraryInfo.php         # Library info
│   ├── BatchResponse.php       # API response
│   ├── ValidationError.php     # Validation error
│   └── ConfigurationException.php
├── tests/
│   ├── ClientTest.php
│   ├── EventTest.php
│   └── ...
├── composer.json
├── phpunit.xml
└── README.md

Code Style

  • Follow PSR-12 coding standard
  • Use strict types (declare(strict_types=1))
  • Add PHPDoc comments for public methods
  • Use type hints for all parameters and return types
  • Keep methods small and focused

Running Tests

# Run all tests
composer test

# Run with verbose output
vendor/bin/phpunit --testdox

# Run specific test file
vendor/bin/phpunit tests/EventTest.php

# Run specific test method
vendor/bin/phpunit --filter testGeneratesUuid

Questions?

If you have questions about contributing, feel free to open an issue and we'll be happy to help!

License

By contributing, you agree that your contributions will be licensed under the MIT License.