PHPackages                             alaureati-enerds/replio - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. alaureati-enerds/replio

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

alaureati-enerds/replio
=======================

Utility Library for JSON responses

v1.1.2(1y ago)07MITPHPPHP &gt;=7.4

Since Dec 13Pushed 1y ago1 watchersCompare

[ Source](https://github.com/alaureati-enerds/replio)[ Packagist](https://packagist.org/packages/alaureati-enerds/replio)[ RSS](/packages/alaureati-enerds-replio/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (5)Used By (0)

Replio
======

[](#replio)

Replio è una libreria PHP progettata per semplificare la gestione delle risposte HTTP nelle applicazioni web. Offre un'interfaccia flessibile per creare risposte standardizzate con supporto per codici di stato, header personalizzati e opzioni di codifica JSON.

Caratteristiche
---------------

[](#caratteristiche)

- Creazione di risposte HTTP standardizzate
- Supporto per codici di stato HTTP predefiniti
- Personalizzazione di header HTTP
- Aggiunta di dati ed errori alle risposte
- Opzioni di codifica JSON personalizzabili
- Facile da integrare e utilizzare

Installazione
-------------

[](#installazione)

1. Aggiungi il pacchetto al tuo progetto utilizzando Composer:

    ```
    composer require alaureati-enerds/replio
    ```
2. Assicurati che il file `vendor/autoload.php` sia incluso nel tuo progetto per caricare automaticamente la classe:

    ```
    require_once 'vendor/autoload.php';
    ```

Utilizzo
--------

[](#utilizzo)

### Risposta di successo

[](#risposta-di-successo)

```
use Replio\Replio;

$replio = new Replio();
$replio->success('Operazione completata con successo!', ['key' => 'value'])
       ->send();
```

### Risposta di errore

[](#risposta-di-errore)

```
use Replio\Replio;

$replio = new Replio();
$replio->error('Errore nella richiesta', Replio::HTTP_BAD_REQUEST, ['campo' => 'Errore dettagliato'])
       ->send();
```

### Personalizzazione della risposta

[](#personalizzazione-della-risposta)

```
use Replio\Replio;

$replio = new Replio();
$replio->withData(['chiave' => 'valore'])
       ->withStatus(Replio::HTTP_CREATED)
       ->withHeaders(['X-Custom-Header' => 'Valore personalizzato'])
       ->send();
```

Metodi Principali
-----------------

[](#metodi-principali)

#### `success(string $message = '', $data = null): self`

[](#successstring-message---data--null-self)

Imposta una risposta di successo.

#### `error(string $message, int $httpStatus = 400, array $errors = []): self`

[](#errorstring-message-int-httpstatus--400-array-errors---self)

Imposta una risposta di errore.

#### `withData($data): self`

[](#withdatadata-self)

Aggiunge dati alla risposta.

#### `withErrors(array $errors): self`

[](#witherrorsarray-errors-self)

Aggiunge errori specifici alla risposta.

#### `withStatus(int $httpStatus): self`

[](#withstatusint-httpstatus-self)

Imposta il codice di stato HTTP della risposta.

#### `withHeaders(array $headers): self`

[](#withheadersarray-headers-self)

Aggiunge header personalizzati alla risposta.

#### `withJsonOptions(int $options): self`

[](#withjsonoptionsint-options-self)

Imposta le opzioni di codifica JSON.

#### `send(): void`

[](#send-void)

Invia la risposta HTTP al client.

Licenza
-------

[](#licenza)

Questo progetto è rilasciato sotto la licenza MIT. Per ulteriori dettagli, consulta il file LICENSE.

Contributi
----------

[](#contributi)

I contributi sono benvenuti! Sentiti libero di aprire una issue o creare una pull request.

Contatti
--------

[](#contatti)

Per domande o segnalazioni, puoi scrivere una mail a .

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance42

Moderate activity, may be stable

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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.

###  Release Activity

Cadence

Every ~1 days

Total

4

Last Release

509d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2aacb3989785a34a72e693f71a18a2c05bc56542849ce90ef9e5bcf55245488d?d=identicon)[alaureati-enerds](/maintainers/alaureati-enerds)

---

Top Contributors

[![alaureati-enerds](https://avatars.githubusercontent.com/u/127527027?v=4)](https://github.com/alaureati-enerds "alaureati-enerds (6 commits)")

### Embed Badge

![Health badge](/badges/alaureati-enerds-replio/health.svg)

```
[![Health](https://phpackages.com/badges/alaureati-enerds-replio/health.svg)](https://phpackages.com/packages/alaureati-enerds-replio)
```

PHPackages © 2026

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