1. Add Code Climate's php-test-reporter to your composer.json
{
 "require-dev": {
   "codeclimate/php-test-reporter": "dev-master"
  }
}
  1. Install it using composer
php composer.phar install --dev
  1. Generate coverage data
phpunit --coverage-clover build/logs/clover.xml
  1. Send the coverage data to Code Climate
CODECLIMATE_REPO_TOKEN=<token> ./vendor/bin/test-reporter

You can find your Code Climate repo token by following these steps. Note that this is not your personal access token.

Note: This token is specific to this repo on Code Climate and grants any user the ability to submit test coverage reports on your behalf. We recommend defining this token as an environment variable within your CI's user interface or configuration file.

More comprehensive instructions and source code can be found on GitHub.

PHP