PsrTransportFactory
in package
implements
TransportFactoryInterface
uses
LogsMessagesTrait
FinalYes
Table of Contents
Interfaces
Properties
- $client : ClientInterface|null
- $requestFactory : RequestFactoryInterface|null
- $streamFactory : StreamFactoryInterface|null
Methods
- __construct() : mixed
- create() : TransportInterface
- discover() : self
- logDebug() : void
- logError() : void
- logInfo() : void
- logNotice() : void
- logWarning() : void
- doLog() : void
- Logging is best effort: a failing log writer (for example an error handler that throws on `trigger_error`) must not break the code that is being observed.
- findClient() : ClientInterface
- shouldLog() : bool
Properties
$client
private
ClientInterface|null
$client
= null
$requestFactory
private
RequestFactoryInterface|null
$requestFactory
= null
$streamFactory
private
StreamFactoryInterface|null
$streamFactory
= null
Methods
__construct()
public
__construct([ClientInterface|null $client = null ][, RequestFactoryInterface|null $requestFactory = null ][, StreamFactoryInterface|null $streamFactory = null ]) : mixed
Parameters
- $client : ClientInterface|null = null
- $requestFactory : RequestFactoryInterface|null = null
- $streamFactory : StreamFactoryInterface|null = null
create()
public
create(string $endpoint, string $contentType[, array<string|int, mixed> $headers = [] ][, mixed $compression = null ][, float $timeout = 10.0 ][, int $retryDelay = 100 ][, int $maxRetries = 3 ][, string|null $cacert = null ][, string|null $cert = null ][, string|null $key = null ]) : TransportInterface
Parameters
- $endpoint : string
- $contentType : string
- $headers : array<string|int, mixed> = []
- $compression : mixed = null
- $timeout : float = 10.0
- $retryDelay : int = 100
- $maxRetries : int = 3
- $cacert : string|null = null
- $cert : string|null = null
- $key : string|null = null
Tags
Attributes
- #[Override]
Return values
TransportInterfacediscover()
public
static discover() : self
Return values
selflogDebug()
protected
static logDebug(string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
- $message : string
- $context : array<string|int, mixed> = []
logError()
protected
static logError(string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
- $message : string
- $context : array<string|int, mixed> = []
logInfo()
protected
static logInfo(string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
- $message : string
- $context : array<string|int, mixed> = []
logNotice()
protected
static logNotice(string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
- $message : string
- $context : array<string|int, mixed> = []
logWarning()
protected
static logWarning(string $message[, array<string|int, mixed> $context = [] ]) : void
Parameters
- $message : string
- $context : array<string|int, mixed> = []
doLog()
Logging is best effort: a failing log writer (for example an error handler that throws on `trigger_error`) must not break the code that is being observed.
private
static doLog(string $level, string $message, array<string|int, mixed> $context) : void
Parameters
- $level : string
- $message : string
- $context : array<string|int, mixed>
findClient()
private
static findClient(float $timeout, string|null $cacert, string|null $cert, string|null $key) : ClientInterface
Parameters
- $timeout : float
- $cacert : string|null
- $cert : string|null
- $key : string|null
Return values
ClientInterfaceshouldLog()
private
static shouldLog(string $level) : bool
Parameters
- $level : string