Releases: php-xapi/serializer
2.2.0
2.1.0
2.0.0
Raw attachment content data must be passed in order to make it possible for serializer implementiations to populate the $content
attribute of Attachment
objects during deserialization.
In order to achieve this an optional $attachments
argument has been added to the StatementResultSerializerInterface::deserializeStatementResult()
, and the deserializeStatement()
and deserializeStatements()
methods of the StatementSerializerInterface
.
When being passed, this argument must be an array mapping SHA-2 hashes to an array which in turn maps the type
and content
keys to the attachment's content type and raw content data respectively.
1.0.0
0.4.0
-
The serializer implementation has been separated from its API definition. This package now no longer ships with an implementation.
The Symfony Serializer component integration has been moved to the separate php-xapi/symfony-serializer package.
A default implementation of the
SerializerRegistryInterface
is still part of thephp-xapi/serializer
package though.This package ships with the following interfaces that must be implemented by packages that want to provide the xAPI serialization functionality:
ActorSerializerInterface
DocumentDataSerializerInterface
StatementResultSerializerInterface
StatementSerializerInterface
StatementFactoryInterface
Implementors of the API provided by this package are advised to add the
php-xapi/serializer-implementation
package to theprovide
section of theircomposer.json
file.The
Tests
subnamespace of this package contains a set of base abstract PHPUnit test classes integrators can use to make sure that their implementation adheres to the API specified by thephp-xapi/serializer
package. -
Added a
SerializerFactoryInterface
that abstracts the creation of serializer instances. -
The
SerializerRegistry
class is now final. If you need custom behavior inside the serializer registry, create your own implementation of theSerializerRegistryInterface
.
0.3.0
- Normalization and denormalization support for
IRI
andIRL
instances where they have been introduced in thephp-xapi/model
package. - Fixed that context attributes are no longer ignored when statements are normalized/denormalized.
- Added support for normalizing/denormalizing activity definition extensions.
- Added support for normalizing/denormalizing statement activity interactions.
- Added support for normalizing/denormalizing
LanguageMap
instances which is now the data type for the$display
property of theVerb
class as well as for the$name
and$description
properties of theDefinition
class. - Updated how statement ids are normalized/denormalized to reflect the introduction of the
StatementId
value object in thephp-xapi/model
package. - Added support for normalizing and denormalizing statement contexts, context activities, and extensions.
- Properly denormalize statement objects (activities, agents, groups, statement references, and sub statements).
v0.2.2
v0.2.1
- The object type is now optional. When the
objectType
key is omitted while an object is deserialized, it is to be assumed that the type of the denormalized object is activity. - Empty PHP arrays are now dumped as JSON objects instead of empty lists.
- fixed the key of the mbox SHA1 sum property when denormalizing actors
- fixed deserializing incomplete agent objects that are missing the required IRI (the
ActorNormalizer
wil now throw an exception) - add a
FilterNullValueNormalizer
that preventsnull
values from being serialized - empty group member lists are not normalized, but the property will be omitted
- ignore nullable result properties when they are not set during normalization and denormalization
v0.2.0
v0.1.0
First release leveraging the JMS serializer library to convert xAPI model objects into JSON strings confirming to the xAPI specs and vice versa.
This package replaces the xabbuh/xapi-serializer
package which is now deprecated and should no longer be used.