PHPackages                             acamposm/atlas-sonarqube-connector - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. acamposm/atlas-sonarqube-connector

ActiveLibrary[API Development](/categories/api)

acamposm/atlas-sonarqube-connector
==================================

A PHP connector for the SonarQube API.

00PHP

Since May 3Pushed 1mo agoCompare

[ Source](https://github.com/angelcamposm/atlas-sonarqube-connector)[ Packagist](https://packagist.org/packages/acamposm/atlas-sonarqube-connector)[ RSS](/packages/acamposm-atlas-sonarqube-connector/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependenciesVersions (2)Used By (0)

Atlas SonarQube Connector
=========================

[](#atlas-sonarqube-connector)

[![Tests](https://github.com/acamposm/atlas-sonarqube-connector/actions/workflows/tests.yml/badge.svg)](https://github.com/acamposm/atlas-sonarqube-connector/actions/workflows/tests.yml)[![PHP Version](https://camo.githubusercontent.com/b8af45eda09008deba8734565358a0243be33c8c835875b7a60eadb69a11485a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253545382e352d3838393262662e737667)](https://php.net)[![License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](LICENSE.md)

A modern, resource-based PHP connector for the SonarQube API. Supports both stable v1 and emerging v2 endpoints.

Features
--------

[](#features)

- **Resource-Based Architecture:** Organized and scalable API interaction.
- **PHP 8.5+ Support:** Leverages modern features like Property Hooks.
- **Dual API Support:** Seamlessly handles both SonarQube API v1 and v2.
- **Fully Tested:** 100% code coverage.
- **Static Analysis:** Verified with PHPStan Level 5+.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require acamposm/atlas-sonarqube-connector
```

Usage
-----

[](#usage)

```
use Atlas\Connectors\SonarQube\Enums\Metric;
use Atlas\Connectors\SonarQube\Exceptions\ApiException;
use Atlas\Connectors\SonarQube\Exceptions\AuthenticationException;
use Atlas\Connectors\SonarQube\Exceptions\SonarQubeException;
use Atlas\Connectors\SonarQube\SonarQubeClient;

// Initialize the client
$client = new SonarQubeClient('https://sonarqube.example.com', 'your-api-token');

// Access system health (API v2)
$health = $client->system()->getHealth();

// Search for projects (API v1)
$projects = $client->projects()->search(['q' => 'my-project']);

// Get project metrics (API v1) using strings or Enums
try {
    $metrics = $client->measures()->getComponentMeasures('my-project-key', [
        Metric::NCLOC,
        Metric::COVERAGE,
        'bugs'
    ]);
} catch (AuthenticationException $e) {
    echo "Invalid API token: " . $e->getMessage();
} catch (ApiException $e) {
    echo "API Error ({$e->getCode()}): " . $e->getMessage();
} catch (SonarQubeException $e) {
    echo "Generic Package Error: " . $e->getMessage();
}
```

Documentation
-------------

[](#documentation)

- [Using in Laravel](docs/laravel.md)

Available Resources
-------------------

[](#available-resources)

- `analysis()`: Scanner Engine version and metadata.
- `languages()`: Supported programming languages.
- `measures()`: Component metrics and measures.
- `projects()`: Project search and management.
- `server()`: Server version and info.
- `system()`: Health, liveness, and system status.
- `users()`: User management and search.

Testing
-------

[](#testing)

```
./vendor/bin/phpunit
```

Static Analysis
---------------

[](#static-analysis)

```
./vendor/bin/phpstan analyse
```

SonarQube Integration
---------------------

[](#sonarqube-integration)

To report coverage and test results to SonarQube, use the following properties:

```
sonar.php.coverage.reportPaths=build/logs/clover.xml
sonar.php.tests.reportPath=build/logs/junit.xml
```

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance61

Regular maintenance activity

Popularity0

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity13

Early-stage or recently created project

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/abe2ce7c293312ef08e979cc3254362328d7b5a1a73c24656afd6077f3b0f2ad?d=identicon)[angel.campos.m](/maintainers/angel.campos.m)

---

Tags

idplaravelphp8sonarqube

### Embed Badge

![Health badge](/badges/acamposm-atlas-sonarqube-connector/health.svg)

```
[![Health](https://phpackages.com/badges/acamposm-atlas-sonarqube-connector/health.svg)](https://phpackages.com/packages/acamposm-atlas-sonarqube-connector)
```

###  Alternatives

[facebook/php-business-sdk

PHP SDK for Facebook Business

90923.5M35](/packages/facebook-php-business-sdk)[exsyst/swagger

A php library to manipulate Swagger specifications

35916.3M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24015.5M18](/packages/hubspot-api-client)[botman/driver-telegram

Telegram driver for BotMan

93452.6k6](/packages/botman-driver-telegram)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
