Documentation

EncodeIfSupported

Tags
psalm-template

BSONType

psalm-template

NativeType

Table of Contents

Methods

canEncode()  : bool
encode()  : mixed
encodeIfSupported()  : mixed

Methods

canEncode()

public abstract canEncode(mixed $value) : bool
Parameters
$value : mixed
Tags
psalm-assert-if-true

NativeType $value

Return values
bool

encode()

public abstract encode(mixed $value) : mixed
Parameters
$value : mixed
Tags
psalm-param

NativeType $value

psalm-return

BSONType

throws
UnsupportedValueException

if the encoder does not support the value

encodeIfSupported()

public encodeIfSupported(mixed $value) : mixed
Parameters
$value : mixed
Tags
psalm-return

($value is NativeType ? BSONType : $value)


        
On this page

Search results