pwm / sfw-request
Simple Request for JSON APIs
Installs: 5 324
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: >=7.1.0
Requires (Dev)
- phpstan/phpstan: ^0.7.0
- phpunit/phpunit: ^6.1
- squizlabs/php_codesniffer: ^3.0
This package is auto-updated.
Last update: 2025-03-29 00:32:38 UTC
README
A simple Request object for JSON APIs.
Table of Contents
Requirements
PHP 7.1+
Installation
composer require pwm/sfw-request
Usage
// Create request $request = new Request( new DateTimeImmutable(), $_SERVER['CONTENT_TYPE'], $_SERVER['REQUEST_METHOD'], $_SERVER['REQUEST_URI'], $_GET, file_get_contents('php://input') ); // Access properties $time = $request->getTime(); $contentType = $request->getContentType(); $method = $request->getMethod(); $uri = $request->getUri(); $query = $request->getQuery(); $json = $request->getJson();
How it works
TBD
Tests
$ vendor/bin/phpunit
$ composer phpcs
$ composer phpstan