w3lifer/php-response-interface

PHP Response Interface

Maintainers

Package info

github.com/w3roman/php-response-interface

pkg:composer/w3lifer/php-response-interface

Statistics

Installs: 4

Dependents: 1

Suggesters: 0

Stars: 0

Open Issues: 0

1.0.3 2025-02-09 18:47 UTC

This package is auto-updated.

Last update: 2026-03-01 00:58:33 UTC


README

Installation

composer require w3lifer/php-response-interface

Usage

PhpResponseInterface::getFalseResponse(); // ['success' => false, 'errors' => []
PhpResponseInterface::getFalseResponse(['Some error']); // ['success' => false, 'errors' => ['Some error']]

PhpResponseInterface::getTrueResponse(); // ['success' => true, 'data' => []]
PhpResponseInterface::getTrueResponse(['Some data']); // ['success' => true, 'data' => ['Some data']]

Tests

make tests