SerializerHelperTrait
trait SerializerHelperTrait (View source)
Stubs-specific serialization extending the shared SubEntitySerializerTrait.
Overrides the enrich*() hooks to append stub metadata (phpDoc, sinceVersion, removedVersion, deprecatedSinceVersion, 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
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
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
protected string|null
serializePhpDoc(string|null $entityId, string|null $phpDoc, PhpDocRepository|null $phpDocStorage)
No description
protected string|null
deserializePhpDoc(string|null $entityId, string|null $inlinePhpDoc, PhpDocRepository|null $phpDocStorage)
No description