Skip to content

Latest commit

 

History

History
40 lines (26 loc) · 1 KB

File metadata and controls

40 lines (26 loc) · 1 KB

Contributing

Thanks for your interest in improving the PostHog PHP SDK.

Development setup

  1. Install PHP and Composer.

  2. Install dependencies using the same command CI uses:

    composer install --prefer-dist --no-progress

Running the example app

  1. Copy .env.example to .env and add your PostHog credentials.

  2. Run the interactive example script:

    php example.php

CI-aligned checks

Run the test command used in CI:

XDEBUG_MODE=coverage ./vendor/bin/phpunit --bootstrap vendor/autoload.php --configuration phpunit.xml --coverage-text

CI also runs PHP_CodeSniffer with phpcs.xml. You can run an equivalent local check with:

curl -OL https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar
php phpcs.phar --standard=phpcs.xml --extensions=php .

Pull requests

Please follow the existing project conventions and include tests when you change behavior.