Documentation

JsonFormatter extends AbstractFormatter

Class JsonFormatter

Table of Contents

Properties

$decodeOptions  : array<string|int, mixed>
$encodeOptions  : array<string|int, mixed>

Methods

__construct()  : mixed
IniFormatter constructor.
__serialize()  : array<string|int, mixed>
__unserialize()  : void
decode()  : mixed
Decode a string into data.
encode()  : string
Encode data into a string.
getDecodeAssoc()  : bool
Returns true if JSON objects will be converted into associative arrays.
getDecodeDepth()  : int
Returns recursion depth used in decode() function.
getDecodeOptions()  : int
Returns options used in decode() function.
getDefaultFileExtension()  : string
Get default file extension from current formatter (with dot).
getEncodeOptions()  : int
Returns options used in encode() function.
getMimeType()  : string
getSupportedFileExtensions()  : array<string|int, string>
Get file extensions supported by current formatter (with dot).
serialize()  : string
unserialize()  : void
getConfig()  : mixed
Get either full configuration or a single option.
getUnserializeAllowedClasses()  : array<string|int, mixed>|bool

Properties

$decodeOptions

protected array<string|int, mixed> $decodeOptions = ['JSON_BIGINT_AS_STRING' => JSON_BIGINT_AS_STRING, 'JSON_INVALID_UTF8_IGNORE' => JSON_INVALID_UTF8_IGNORE, 'JSON_INVALID_UTF8_SUBSTITUTE' => JSON_INVALID_UTF8_SUBSTITUTE, 'JSON_OBJECT_AS_ARRAY' => JSON_OBJECT_AS_ARRAY]

$encodeOptions

protected array<string|int, mixed> $encodeOptions = ['JSON_FORCE_OBJECT' => JSON_FORCE_OBJECT, 'JSON_HEX_QUOT' => JSON_HEX_QUOT, 'JSON_HEX_TAG' => JSON_HEX_TAG, 'JSON_HEX_AMP' => JSON_HEX_AMP, 'JSON_HEX_APOS' => JSON_HEX_APOS, 'JSON_INVALID_UTF8_IGNORE' => JSON_INVALID_UTF8_IGNORE, 'JSON_INVALID_UTF8_SUBSTITUTE' => JSON_INVALID_UTF8_SUBSTITUTE, 'JSON_NUMERIC_CHECK' => JSON_NUMERIC_CHECK, 'JSON_PARTIAL_OUTPUT_ON_ERROR' => JSON_PARTIAL_OUTPUT_ON_ERROR, 'JSON_PRESERVE_ZERO_FRACTION' => JSON_PRESERVE_ZERO_FRACTION, 'JSON_PRETTY_PRINT' => JSON_PRETTY_PRINT, 'JSON_UNESCAPED_LINE_TERMINATORS' => JSON_UNESCAPED_LINE_TERMINATORS, 'JSON_UNESCAPED_SLASHES' => JSON_UNESCAPED_SLASHES, 'JSON_UNESCAPED_UNICODE' => JSON_UNESCAPED_UNICODE]

Methods

__construct()

IniFormatter constructor.

public __construct([array<string|int, mixed> $config = [] ]) : mixed
Parameters
$config : array<string|int, mixed> = []

__serialize()

public __serialize() : array<string|int, mixed>
Return values
array<string|int, mixed>

__unserialize()

public __unserialize(array<string|int, mixed> $data) : void
Parameters
$data : array<string|int, mixed>

getDecodeAssoc()

Returns true if JSON objects will be converted into associative arrays.

public getDecodeAssoc() : bool
Return values
bool

getDecodeDepth()

Returns recursion depth used in decode() function.

public getDecodeDepth() : int
Tags
phpstan-return

positive-int

Return values
int

getDecodeOptions()

Returns options used in decode() function.

public getDecodeOptions() : int
Return values
int

getEncodeOptions()

Returns options used in encode() function.

public getEncodeOptions() : int
Return values
int

serialize()

public final serialize() : string
Return values
string

unserialize()

public final unserialize(string $serialized) : void
Parameters
$serialized : string

getConfig()

Get either full configuration or a single option.

protected getConfig([string|null $name = null ]) : mixed
Parameters
$name : string|null = null

Configuration option (optional)

getUnserializeAllowedClasses()

protected getUnserializeAllowedClasses() : array<string|int, mixed>|bool
Return values
array<string|int, mixed>|bool

        
On this page

Search results