class StubsEntitySerializer implements EntitySerializerInterface (View source)

Serializer for stub entities that includes all stub-specific metadata:

  • PhpDoc comments (raw text)
  • Version information (sinceVersion, removedVersion)
  • Type information from multiple sources (signature, PhpDoc, LanguageLevelTypeAware)
  • LanguageLevelTypeAware attribute data (version-specific types)

This class now acts as a facade/coordinator that delegates to entity-specific serializers using the registry pattern.

Methods

__construct(PhpDocStorage|null $phpDocStorage = null)

No description

array
serialize(mixed $entity)

Serialize an entity to array format suitable for JSON encoding.

mixed
deserialize(array $data)

Deserialize an entity from array format.

Details

__construct(PhpDocStorage|null $phpDocStorage = null)

No description

Parameters

PhpDocStorage|null $phpDocStorage

array serialize(mixed $entity)

Serialize an entity to array format suitable for JSON encoding.

Parameters

mixed $entity

The entity to serialize (PHPClass, PHPFunction, etc.)

Return Value

array

The serialized entity data

mixed deserialize(array $data)

Deserialize an entity from array format.

Parameters

array $data

The serialized entity data

Return Value

mixed

The reconstructed entity object