SubEntitySerializerTrait
trait SubEntitySerializerTrait (View source)
Shared sub-entity serialization logic for both Stubs and Reflection serializers.
Contains core serialize/deserialize methods for methods, parameters, properties, and class constants. Stubs serializers override the enrich*() hooks to append stub-specific metadata (phpDoc, sinceVersion, removedVersion, LanguageLevelTypeAware). Reflection serializers use this trait directly — the default no-op hooks produce clean reflection-only output.
Traits
Shared utility methods for serializers: type parsing and JSON-safe conversion.
Methods
Convert value to JSON-safe format, filtering out resources and closures
Parse a type string back into the correct type object.
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
Details
protected
toJsonSafe($value)
Convert value to JSON-safe format, filtering out resources and closures
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
protected array
serializeMethod(PHPMethod $method, string|null $parentId = null, PhpDocStorage|null $phpDocStorage = null)
No description
protected array
serializeParameter(PHPParameter $parameter, PhpDocStorage|null $phpDocStorage = null)
No description
protected array
serializeProperty(PHPProperty $property, string|null $parentId = null, PhpDocStorage|null $phpDocStorage = null)
No description
protected array
serializeClassConstant(PHPClassConstant $constant)
No description
protected PHPMethod
deserializeMethod(array $data, string|null $parentId = null, PhpDocStorage|null $phpDocStorage = null)
No description
protected PHPParameter
deserializeParameter(array $data, PhpDocStorage|null $phpDocStorage = null)
No description
protected PHPProperty
deserializeProperty(array $data, string|null $parentId = null, PhpDocStorage|null $phpDocStorage = null)
No description
protected PHPClassConstant
deserializeClassConstant(array $data)
No description
protected void
enrichSerializedMethod(array $data, PHPMethod $method, string|null $parentId, PhpDocStorage|null $phpDocStorage)
No description
protected void
enrichSerializedParameter(array $data, PHPParameter $parameter)
No description
protected void
enrichSerializedProperty(array $data, PHPProperty $property, string|null $parentId, PhpDocStorage|null $phpDocStorage)
No description
protected void
enrichSerializedClassConstant(array $data, PHPClassConstant $constant)
No description
protected void
enrichDeserializedMethod(PHPMethod $method, array $data, string|null $parentId, PhpDocStorage|null $phpDocStorage)
No description
protected void
enrichDeserializedParameter(PHPParameter $parameter, array $data)
No description
protected void
enrichDeserializedProperty(PHPProperty $property, array $data, string|null $parentId, PhpDocStorage|null $phpDocStorage)
No description
protected void
enrichDeserializedClassConstant(PHPClassConstant $constant, array $data)
No description