Skip to content

Repository files navigation

ScalarPhpTest PHP API Library

This package provides convenient access to the ScalarPhpTest REST API from PHP applications. It is generated from your OpenAPI document with typed models, resource clients, pagination helpers, and PHP 8.1+ support.

The full generated API reference is available in api.md and the operation inventory is available in reference.md.

Installation

composer require amritk/scalar-test

Usage

Instantiate the generated client and call methods from resource clients.

<?php
use ScalarPhpTest\ScalarPhpTest;
$client = new ScalarPhpTest(

);
$client->ping->ping();

Request and Response Types

Request params and response bodies are generated as typed PHP classes with strict types enabled. Models include array conversion helpers for working with JSON payloads.

Handling Errors

Non-success responses throw generated API exceptions that expose status code, headers, raw response body, and request id metadata when available.

Retries and Timeouts

The runtime supports client-level and per-request timeout, retry, header, query, base URL, and idempotency options. Retryable responses honor Retry-After before exponential backoff.

Pagination

Paginated operations return page helpers that expose response data and next-page metadata when pagination is described by the OpenAPI document.

Raw Responses and Custom Requests

Raw response helpers are available when callers need status, headers, or unparsed response bodies. Per-request options provide an escape hatch for extra headers and query params.

Requirements

PHP 8.1+ with Composer PSR-4 autoloading.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages