A simple Request object for JSON APIs.
PHP 7.1+
composer require pwm/sfw-request
// 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();
TBD
$ vendor/bin/phpunit
$ composer phpcs
$ composer phpstan