Skip to content

Latest commit

 

History

History
62 lines (41 loc) · 1.66 KB

File metadata and controls

62 lines (41 loc) · 1.66 KB

CommonPHP API Documentation

CommonPHP API is the JSON surface layer for CommonPHP applications. It mounts API routes, adapts HTTP requests into API requests, dispatches action handlers, normalizes action return values, and turns expected failures into JSON problem responses.

The package is deliberately small. HTTP primitives stay in comphp/http, route matching stays in comphp/router, and reusable input validation stays in comphp/validation.

Start Here

API Concepts

Examples

Development

Public API Map

Entry points:

  • CommonPHP\API\ApiSurface
  • CommonPHP\API\ApiRequest
  • CommonPHP\API\ApiResponseFactory
  • CommonPHP\API\ApiExceptionHandler

Response objects:

  • CommonPHP\API\JsonResponse
  • CommonPHP\API\ApiProblem
  • CommonPHP\API\ApiProblemResponse

Contracts:

  • CommonPHP\API\Contracts\ActionInterface
  • CommonPHP\API\Contracts\AbstractAction
  • CommonPHP\API\Contracts\ApiResponseInterface

Enums:

  • CommonPHP\API\Enums\ApiStatus

Exceptions:

  • CommonPHP\API\Exceptions\ApiException
  • CommonPHP\API\Exceptions\InvalidActionException
  • CommonPHP\API\Exceptions\UnsupportedContentTypeException