Skip to content

JsonSerializer

Methods

__construct

public __construct(): mixed

Inherited methods

__construct

public __construct(\Qubus\Support\Serializer\Strategy\Strategy $strategy): mixed

Parameters:

Parameter Type Description
$strategy \Qubus\Support\Serializer\Strategy\Strategy

getTransformer

This is handy specially in order to add additional data before the serialization process takes place using the transformer public methods, if any.

public getTransformer(): \Qubus\Support\Serializer\Strategy\Strategy

serialize

Serialize the data.

public serialize(mixed $data): bool|string

Parameters:

Parameter Type Description
$data mixed

Return Value:

Serialized data.

Throws:


reset

Reset variables.

protected reset(): void

serializeData

Parse the data to be serialized.

protected serializeData(mixed $data): mixed

Parameters:

Parameter Type Description
$data mixed

Throws:


guardForUnsupportedValues

protected guardForUnsupportedValues(mixed $data): void

Parameters:

Parameter Type Description
$data mixed

Throws:


unserialize

Unserialize the value from string.

public unserialize(mixed $data): mixed

Parameters:

Parameter Type Description
$data mixed

Throws:


unserializeData

Parse the json decode to convert to objects again.

protected unserializeData(mixed $data): mixed

Parameters:

Parameter Type Description
$data mixed

Throws:


getScalarValue

protected getScalarValue(mixed $value): float|bool|int|string|null

Parameters:

Parameter Type Description
$value mixed

unserializeObject

Convert the serialized array into an object.

protected unserializeObject(array $data): object|null

Parameters:

Parameter Type Description
$data array

Throws:


unserializeDateTimeFamilyObject

protected unserializeDateTimeFamilyObject(array $data, string $className): mixed

Parameters:

Parameter Type Description
$data array
$className string

Throws:


isDateTimeFamilyObject

protected isDateTimeFamilyObject(string $className): bool

Parameters:

Parameter Type Description
$className string

restoreUsingUnserialize

protected restoreUsingUnserialize(string $className, array $attributes): mixed

Parameters:

Parameter Type Description
$className string
$attributes array

Throws:


unserializeUserDefinedObject

protected unserializeUserDefinedObject(array $data, string $className): object

Parameters:

Parameter Type Description
$data array
$className string

Throws:


setUnserializedObjectProperties

protected setUnserializedObjectProperties(array $data, \ReflectionClass $ref, mixed $obj): mixed

Parameters:

Parameter Type Description
$data array
$ref \ReflectionClass
$obj mixed

Throws:


serializeScalar

protected serializeScalar(mixed $data): array|string

Parameters:

Parameter Type Description
$data mixed

serializeArray

protected serializeArray(array $data): array

Parameters:

Parameter Type Description
$data array

Throws:


serializeObject

Extract the data from an object.

protected serializeObject(mixed $data): array

Parameters:

Parameter Type Description
$data mixed

Throws:


serializeInternalClass

protected serializeInternalClass(mixed $value, string $className, \ReflectionClass $ref): array

Parameters:

Parameter Type Description
$value mixed
$className string
$ref \ReflectionClass

getObjectProperties

Return the list of properties to be serialized.

protected getObjectProperties(\ReflectionClass $ref, object $data): array

Parameters:

Parameter Type Description
$ref \ReflectionClass
$data object

extractObjectData

Extract the object data.

protected extractObjectData(mixed $value, \ReflectionClass $rc, array $properties): array

Parameters:

Parameter Type Description
$value mixed
$rc \ReflectionClass
$properties array

extractCurrentObjectProperties

protected extractCurrentObjectProperties(mixed $value, \ReflectionClass $rc, array $properties, array& $data): void

Parameters:

Parameter Type Description
$value mixed
$rc \ReflectionClass
$properties array
$data array

extractAllInhertitedProperties

protected extractAllInhertitedProperties(mixed $value, \ReflectionClass $rc, array& $data): void

Parameters:

Parameter Type Description
$value mixed
$rc \ReflectionClass
$data array


Automatically generated on 2025-10-13