spirit-dev/php-sonarqube-api

This package is abandoned and no longer maintained. No replacement package was suggested.

SonarQube API client for php projects

Maintainers

👁 spirit-dev

Package info

github.com/spirit-dev/php-sonarqube-api

pkg:composer/spirit-dev/php-sonarqube-api

Statistics

Installs: 2 972

Dependents: 3

Suggesters: 0

Stars: 4

Open Issues: 0

0.0.4 2016-09-03 14:45 UTC

Requires

Requires (Dev)

None

Suggests

None

Provides

None

Conflicts

None

Replaces

None

GPL v3 903e1c386ea2dfbd1501816c6a9a45cd855a87dd

apisonarsonarqube

This package is not auto-updated.

Last update: 2025-06-21 23:12:33 UTC


README

A PHP wrapper for use with the SonarQube.

Based on php-sonarqube-api.

Installation

Install Composer

$ curl -sS https://getcomposer.org/installer | php
$ sudo mv composer.phar /usr/local/bin/composer

Add the following to your require block in composer.json config. Note: be careful when using the dev-master tag as this may have unexpected results depending on your version of SonarQube.

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

Include Composer's autoloader:

require_once dirname(__DIR__).'/vendor/autoload.php';

General API Usage

$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']);

Calls can be made either via $client->api('apiSection')->endpoint() or as a property: $client->apiSection->endpoint(). The two syntaxes work identically.

Contributing

This project is currently under development. Many part of SonarQube official API are not parts of this project. Feel free to fork this project, apply modifications and sending me you pull requests.