InitializeHandler implements RequestHandlerInterface
FinalYes
Tags
Table of Contents
Interfaces
- RequestHandlerInterface
- Covariant in TResult: a handler only ever produces its result, so one declaring a concrete result type satisfies a collection of handlers typed by the interface every result implements.
Properties
- $configuration : Configuration|null
Methods
- __construct() : mixed
- handle() : Response<string|int, InitializeResult>
- supports() : bool
- negotiate() : ProtocolVersion
- Picks the protocol version to answer an `initialize` handshake with.
- supportedVersions() : array<int, ProtocolVersion>
- Versions this server is willing to negotiate over `initialize`.
Properties
$configuration read-only
public
Configuration|null
$configuration
= null
Methods
__construct()
public
__construct([Configuration|null $configuration = null ]) : mixed
Parameters
- $configuration : Configuration|null = null
handle()
public
handle(Request $request, SessionInterface $session) : Response<string|int, InitializeResult>
Parameters
- $request : Request
- $session : SessionInterface
Return values
Response<string|int, InitializeResult>supports()
public
supports(Request $request) : bool
Parameters
- $request : Request
Return values
boolnegotiate()
Picks the protocol version to answer an `initialize` handshake with.
private
negotiate(string $requested) : ProtocolVersion
If the client asked for a version this server supports, the spec requires responding with that exact version. Otherwise the server counter-offers the newest version it does support and leaves it to the client to decide whether it can continue on that revision or must disconnect.
Parameters
- $requested : string
Return values
ProtocolVersionsupportedVersions()
Versions this server is willing to negotiate over `initialize`.
private
supportedVersions() : array<int, ProtocolVersion>
A version configured on the server pins the handshake to exactly that
revision. Modern revisions are never offered here: they have no
initialize at all, so a client that reached this handler cannot speak
one, and answering with it would leave the connection unusable.