spirit-dev/php-sonarqube-api
SonarQube API client for php projects
Maintainers
Requires
- php: >=5.3.2
- ext-curl: *
- kriswallsmith/buzz: >=0.7
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
GPL v3 903e1c386ea2dfbd1501816c6a9a45cd855a87dd
- Jean Bordat <bordat.jean.woop@gmail.com>
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.
