class ReflectionInterfaceSerializer implements EntityTypeSerializerInterface (View source)

Reflection serializer for PHPInterface entities.

Only includes data available via PHP Reflection API.

Traits

Shared sub-entity serialization logic for both Stubs and Reflection serializers.

Shared utility methods for serializers: type parsing and JSON-safe conversion.

Methods

toJsonSafe($value)

Convert value to JSON-safe format, filtering out resources and closures

parseType(string|null $typeStr)

Parse a type string back into the correct type object.

array
serializeMethod(PHPMethod $method, string|null $parentId = null, PhpDocStorage|null $phpDocStorage = null)

No description

array
serializeParameter(PHPParameter $parameter, PhpDocStorage|null $phpDocStorage = null)

No description

array
serializeProperty(PHPProperty $property, string|null $parentId = null, PhpDocStorage|null $phpDocStorage = null)

No description

array
serializeClassConstant(PHPClassConstant $constant)

No description

deserializeMethod(array $data, string|null $parentId = null, PhpDocStorage|null $phpDocStorage = null)

No description

deserializeParameter(array $data, PhpDocStorage|null $phpDocStorage = null)

No description

deserializeProperty(array $data, string|null $parentId = null, PhpDocStorage|null $phpDocStorage = null)

No description

void
enrichSerializedMethod(array $data, PHPMethod $method, string|null $parentId, PhpDocStorage|null $phpDocStorage)

No description

void
enrichSerializedParameter(array $data, PHPParameter $parameter)

No description

void
enrichSerializedProperty(array $data, PHPProperty $property, string|null $parentId, PhpDocStorage|null $phpDocStorage)

No description

void
enrichSerializedClassConstant(array $data, PHPClassConstant $constant)

No description

void
enrichDeserializedMethod(PHPMethod $method, array $data, string|null $parentId, PhpDocStorage|null $phpDocStorage)

No description

void
enrichDeserializedParameter(PHPParameter $parameter, array $data)

No description

void
enrichDeserializedProperty(PHPProperty $property, array $data, string|null $parentId, PhpDocStorage|null $phpDocStorage)

No description

void
enrichDeserializedClassConstant(PHPClassConstant $constant, array $data)

No description

bool
supports(mixed $entity)

Check if this serializer supports the given entity.

array
serialize(mixed $entity, PhpDocStorage|null $phpDocStorage = null)

Serialize an entity to array format suitable for JSON encoding.

mixed
deserialize(array $data, PhpDocStorage|null $phpDocStorage = null)

Deserialize an entity from array format.

Details

protected toJsonSafe($value)

Convert value to JSON-safe format, filtering out resources and closures

Parameters

$value

protected StandaloneType|UnionType|NullableType|NoType|IntersectionType parseType(string|null $typeStr)

Parse a type string back into the correct type object.

Rules: "" -> NoType "A&B" -> IntersectionType "(A&B)" -> IntersectionType (parenthesised pure intersection) "A|null" -> NullableType (exactly 2 parts, one is "null") "int|(A&B)|..." -> UnionType with IntersectionType member (DNF) "A|B|..." -> UnionType "?A" -> NullableType "A" -> StandaloneType

Parameters

string|null $typeStr

Return Value

StandaloneType|UnionType|NullableType|NoType|IntersectionType

protected array serializeMethod(PHPMethod $method, string|null $parentId = null, PhpDocStorage|null $phpDocStorage = null)

No description

Parameters

PHPMethod $method
string|null $parentId
PhpDocStorage|null $phpDocStorage

Return Value

array

protected array serializeParameter(PHPParameter $parameter, PhpDocStorage|null $phpDocStorage = null)

No description

Parameters

PHPParameter $parameter
PhpDocStorage|null $phpDocStorage

Return Value

array

protected array serializeProperty(PHPProperty $property, string|null $parentId = null, PhpDocStorage|null $phpDocStorage = null)

No description

Parameters

PHPProperty $property
string|null $parentId
PhpDocStorage|null $phpDocStorage

Return Value

array

protected array serializeClassConstant(PHPClassConstant $constant)

No description

Parameters

PHPClassConstant $constant

Return Value

array

protected PHPMethod deserializeMethod(array $data, string|null $parentId = null, PhpDocStorage|null $phpDocStorage = null)

No description

Parameters

array $data
string|null $parentId
PhpDocStorage|null $phpDocStorage

Return Value

PHPMethod

protected PHPParameter deserializeParameter(array $data, PhpDocStorage|null $phpDocStorage = null)

No description

Parameters

array $data
PhpDocStorage|null $phpDocStorage

Return Value

PHPParameter

protected PHPProperty deserializeProperty(array $data, string|null $parentId = null, PhpDocStorage|null $phpDocStorage = null)

No description

Parameters

array $data
string|null $parentId
PhpDocStorage|null $phpDocStorage

Return Value

PHPProperty

protected PHPClassConstant deserializeClassConstant(array $data)

No description

Parameters

array $data

Return Value

PHPClassConstant

protected void enrichSerializedMethod(array $data, PHPMethod $method, string|null $parentId, PhpDocStorage|null $phpDocStorage)

No description

Parameters

array $data
PHPMethod $method
string|null $parentId
PhpDocStorage|null $phpDocStorage

Return Value

void

protected void enrichSerializedParameter(array $data, PHPParameter $parameter)

No description

Parameters

array $data
PHPParameter $parameter

Return Value

void

protected void enrichSerializedProperty(array $data, PHPProperty $property, string|null $parentId, PhpDocStorage|null $phpDocStorage)

No description

Parameters

array $data
PHPProperty $property
string|null $parentId
PhpDocStorage|null $phpDocStorage

Return Value

void

protected void enrichSerializedClassConstant(array $data, PHPClassConstant $constant)

No description

Parameters

array $data
PHPClassConstant $constant

Return Value

void

protected void enrichDeserializedMethod(PHPMethod $method, array $data, string|null $parentId, PhpDocStorage|null $phpDocStorage)

No description

Parameters

PHPMethod $method
array $data
string|null $parentId
PhpDocStorage|null $phpDocStorage

Return Value

void

protected void enrichDeserializedParameter(PHPParameter $parameter, array $data)

No description

Parameters

PHPParameter $parameter
array $data

Return Value

void

protected void enrichDeserializedProperty(PHPProperty $property, array $data, string|null $parentId, PhpDocStorage|null $phpDocStorage)

No description

Parameters

PHPProperty $property
array $data
string|null $parentId
PhpDocStorage|null $phpDocStorage

Return Value

void

protected void enrichDeserializedClassConstant(PHPClassConstant $constant, array $data)

No description

Parameters

PHPClassConstant $constant
array $data

Return Value

void

bool supports(mixed $entity)

Check if this serializer supports the given entity.

Parameters

mixed $entity

The entity to check

Return Value

bool

True if this serializer can handle the entity

array serialize(mixed $entity, PhpDocStorage|null $phpDocStorage = null)

Serialize an entity to array format suitable for JSON encoding.

Parameters

mixed $entity

The entity to serialize

PhpDocStorage|null $phpDocStorage

Optional PhpDoc storage for external storage

Return Value

array

The serialized entity data

mixed deserialize(array $data, PhpDocStorage|null $phpDocStorage = null)

Deserialize an entity from array format.

Parameters

array $data

The serialized entity data

PhpDocStorage|null $phpDocStorage

Optional PhpDoc storage for external retrieval

Return Value

mixed

The reconstructed entity object