MCP PHP SDK

EraClassification

FinalYes

Which protocol era one inbound HTTP request belongs to.

The outcome of InboundClassifier: an era to route to, or a rejection the entry answers with directly. Never both.

Tags
author

Christopher Hertel mail@christopher-hertel.de

Table of Contents

Properties

$claimedVersion  : string|null
$error  : Error|null
$httpStatus  : int
$modern  : bool

Methods

isRejected()  : bool
legacy()  : self
The handshake era: everything that makes no per-request envelope claim.
modern()  : self
The modern era, claiming $version — which may be one this server does not serve. Routing and support are separate questions, and the dispatcher owns the second one so its answer can name what it does support.
reject()  : self
__construct()  : mixed

Properties

Methods

legacy()

The handshake era: everything that makes no per-request envelope claim.

public static legacy([string|null $claimedVersion = null ]) : self
Parameters
$claimedVersion : string|null = null
Return values
self

modern()

The modern era, claiming $version — which may be one this server does not serve. Routing and support are separate questions, and the dispatcher owns the second one so its answer can name what it does support.

public static modern(string $version) : self
Parameters
$version : string
Return values
self

reject()

public static reject(Error $error, int $httpStatus) : self
Parameters
$error : Error
$httpStatus : int
Return values
self

__construct()

private __construct(bool $modern, string|null $claimedVersion, Error|null $error, int $httpStatus) : mixed
Parameters
$modern : bool
$claimedVersion : string|null
$error : Error|null
$httpStatus : int
On this page

Search results