class Frame implements FrameInterface

Properties

protected StreamInterface $payloadData

Methods

__construct(bool $fin = true, bool $rsv1 = false, bool $rsv2 = false, bool $rsv3 = false, int $opcode = Opcode::TEXT, bool $mask = false, mixed $payloadData = '')

No description

string
__toString()

No description

int
getOpcode()

Get the opcode.

setOpcode(int $opcode)

Set the opcode.

withOpcode(int $opcode)

Return a copy with the given opcode.

bool
getFin()

Determine whether this is the final frame.

setFin(bool $fin)

Set whether this is the final frame.

withFin(bool $fin)

Return a copy with the given final-frame state.

bool
getRSV1()

Get the first reserved bit.

setRSV1(bool $rsv1)

Set the first reserved bit.

withRSV1(bool $rsv1)

Return a copy with the given first reserved bit.

bool
getRSV2()

Get the second reserved bit.

setRSV2(bool $rsv2)

Set the second reserved bit.

withRSV2(bool $rsv2)

Return a copy with the given second reserved bit.

bool
getRSV3()

Get the third reserved bit.

setRSV3(bool $rsv3)

Set the third reserved bit.

withRSV3(bool $rsv3)

Return a copy with the given third reserved bit.

int
getPayloadLength()

Get the payload length.

bool
getMask()

Determine whether the frame is masked.

setMask(bool $mask)

Set whether the frame is masked.

withMask(bool $mask)

Return a copy with the given mask state.

StreamInterface
getPayloadData()

Get the payload data.

setPayloadData(mixed $payloadData)

Set the payload data.

withPayloadData(mixed $payloadData)

Return a copy with the given payload data.

string
toString()

Convert the frame to a string.

static FrameInterface
from(mixed $frame)

Create a frame from the given value.

Details

at line 19
__construct(bool $fin = true, bool $rsv1 = false, bool $rsv2 = false, bool $rsv3 = false, int $opcode = Opcode::TEXT, bool $mask = false, mixed $payloadData = '')

No description

Parameters

bool $fin
bool $rsv1
bool $rsv2
bool $rsv3
int $opcode
bool $mask
mixed $payloadData

at line 31
string __toString()

No description

Return Value

string

at line 36
int getOpcode()

Get the opcode.

Return Value

int

at line 41
FrameInterface setOpcode(int $opcode)

Set the opcode.

Parameters

int $opcode

Return Value

FrameInterface

at line 47
FrameInterface withOpcode(int $opcode)

Return a copy with the given opcode.

Parameters

int $opcode

Return Value

FrameInterface

at line 52
bool getFin()

Determine whether this is the final frame.

Return Value

bool

at line 57
FrameInterface setFin(bool $fin)

Set whether this is the final frame.

Parameters

bool $fin

Return Value

FrameInterface

at line 63
FrameInterface withFin(bool $fin)

Return a copy with the given final-frame state.

Parameters

bool $fin

Return Value

FrameInterface

at line 68
bool getRSV1()

Get the first reserved bit.

Return Value

bool

at line 73
FrameInterface setRSV1(bool $rsv1)

Set the first reserved bit.

Parameters

bool $rsv1

Return Value

FrameInterface

at line 79
FrameInterface withRSV1(bool $rsv1)

Return a copy with the given first reserved bit.

Parameters

bool $rsv1

Return Value

FrameInterface

at line 84
bool getRSV2()

Get the second reserved bit.

Return Value

bool

at line 89
FrameInterface setRSV2(bool $rsv2)

Set the second reserved bit.

Parameters

bool $rsv2

Return Value

FrameInterface

at line 95
FrameInterface withRSV2(bool $rsv2)

Return a copy with the given second reserved bit.

Parameters

bool $rsv2

Return Value

FrameInterface

at line 100
bool getRSV3()

Get the third reserved bit.

Return Value

bool

at line 105
FrameInterface setRSV3(bool $rsv3)

Set the third reserved bit.

Parameters

bool $rsv3

Return Value

FrameInterface

at line 111
FrameInterface withRSV3(bool $rsv3)

Return a copy with the given third reserved bit.

Parameters

bool $rsv3

Return Value

FrameInterface

at line 116
int getPayloadLength()

Get the payload length.

Return Value

int

at line 121
bool getMask()

Determine whether the frame is masked.

Return Value

bool

at line 126
FrameInterface setMask(bool $mask)

Set whether the frame is masked.

Parameters

bool $mask

Return Value

FrameInterface

at line 132
FrameInterface withMask(bool $mask)

Return a copy with the given mask state.

Parameters

bool $mask

Return Value

FrameInterface

at line 137
StreamInterface getPayloadData()

Get the payload data.

Return Value

StreamInterface

at line 142
FrameInterface setPayloadData(mixed $payloadData)

Set the payload data.

Parameters

mixed $payloadData

Return Value

FrameInterface

at line 148
FrameInterface withPayloadData(mixed $payloadData)

Return a copy with the given payload data.

Parameters

mixed $payloadData

Return Value

FrameInterface

at line 153
string toString()

Convert the frame to a string.

Return Value

string

at line 162
static FrameInterface from(mixed $frame)

Create a frame from the given value.

Parameters

mixed $frame

Return Value

FrameInterface