PHP code example of spirit-dev / php-sonarqube-api

1. Go to this page and download the library: Download spirit-dev/php-sonarqube-api 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/ */

    

spirit-dev / php-sonarqube-api example snippets




$client = new \SonarQube\Client('http://sonar.domain.com/api/', 'username', 'password'); // change here
$authentication = $client->api('authentication')->validate();
$projects = $client->projects->search(['search'=>'XYZ']);
$measures = $client->measures->component(['componentKey'=>'ABC.XYZ','metricKeys'=>'ncloc_language_distribution,complexity,violations']);

"spirit-dev/php-sonarqube-api": "dev-master"