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
Return the short (unqualified) form of a possibly-qualified class name.
Convert value to JSON-safe format, filtering out resources and closures
Parse a type string (already fully-qualified, as stored in the cache) back into the correct type object. Leaf names are used verbatim — see {TypeStringParser} for the grammar handled.
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
Details
protected string|null
shortClassName(string|null $name)
Return the short (unqualified) form of a possibly-qualified class name.
E.g. "\Foo\Bar" or "Foo\Bar" -> "Bar"; "Bar" -> "Bar".
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 (already fully-qualified, as stored in the cache) back into the correct type object. Leaf names are used verbatim — see {TypeStringParser} for the grammar handled.
protected array
serializeMethod(PHPMethod $method, string|null $parentId = null, PhpDocRepository|null $phpDocStorage = null)
No description
protected array
serializeParameter(PHPParameter $parameter, PhpDocRepository|null $phpDocStorage = null)
No description
protected array
serializeProperty(PHPProperty $property, string|null $parentId = null, PhpDocRepository|null $phpDocStorage = null)
No description
protected array
serializeClassConstant(PHPClassConstant $constant)
No description
protected PHPMethod
deserializeMethod(array $data, string|null $parentId = null, PhpDocRepository|null $phpDocStorage = null)
No description
protected PHPParameter
deserializeParameter(array $data, PhpDocRepository|null $phpDocStorage = null)
No description
protected PHPProperty
deserializeProperty(array $data, string|null $parentId = null, PhpDocRepository|null $phpDocStorage = null)
No description
protected PHPClassConstant
deserializeClassConstant(array $data)
No description
protected void
enrichSerializedMethod(array $data, PHPMethod $method, string|null $parentId, PhpDocRepository|null $phpDocStorage)
No description
protected void
enrichSerializedParameter(array $data, PHPParameter $parameter)
No description
protected void
enrichSerializedProperty(array $data, PHPProperty $property, string|null $parentId, PhpDocRepository|null $phpDocStorage)
No description
protected void
enrichSerializedClassConstant(array $data, PHPClassConstant $constant)
No description
protected void
enrichDeserializedMethod(PHPMethod $method, array $data, string|null $parentId, PhpDocRepository|null $phpDocStorage)
No description
protected void
enrichDeserializedParameter(PHPParameter $parameter, array $data)
No description
protected void
enrichDeserializedProperty(PHPProperty $property, array $data, string|null $parentId, PhpDocRepository|null $phpDocStorage)
No description
protected void
enrichDeserializedClassConstant(PHPClassConstant $constant, array $data)
No description