PHP code example of codacy / coverage

1. Go to this page and download the library: Download codacy/coverage library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

codacy / coverage example snippets



 vendor/bin/codacycoverage phpunit
 vendor/bin/codacycoverage clover path/to/a-clover.xml
 vendor/bin/codacycoverage phpunit directory/path/to/phpunitreport
sh
# install
$ php composer.phar install --dev
# update
$ php composer.phar update codacy/coverage --dev
yml
# .travis.yml
language: php

# Do not forget to provide your CODACY_PROJECT_TOKEN as described in https://docs.travis-ci.com/user/environment-variables/#Defining-Variables-in-Repository-Settings

php:
  - 5.3
  - 5.4
  - 5.5
  - 5.6
  - hhvm

# In case of timeouts and build failures you may want to prepend 'travis_retry' to the following commands:
before_script:
  - curl -s http://getcomposer.org/installer | php
  - php composer.phar install -n

script:
  - php vendor/bin/phpunit --coverage-clover build/coverage/xml

after_script:
  - php vendor/bin/codacycoverage clover build/coverage/xml

PHP Fatal error:  Uncaught Error: Call to undefined function Codacy\Coverage\Util\curl_init() in /src/Codacy/Coverage/Util/CodacyApiClient.php:30