SerializerHelperTrait
trait SerializerHelperTrait (View source)
Stubs-specific serialization extending the shared SubEntitySerializerTrait.
Overrides the enrich*() hooks to append stub metadata (phpDoc, sinceVersion, removedVersion, LanguageLevelTypeAware fields) to serialized/deserialized entities. Also provides PhpDoc storage helper methods.
Traits
Shared sub-entity serialization logic for both Stubs and Reflection serializers.
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
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
protected string|null
serializePhpDoc(string|null $entityId, string|null $phpDoc, PhpDocStorage|null $phpDocStorage)
No description
protected string|null
deserializePhpDoc(string|null $entityId, string|null $inlinePhpDoc, PhpDocStorage|null $phpDocStorage)
No description