Files
Chamilo/vendor/php-xapi/serializer/UPGRADE.md
T
Xes 73154ae174
Behat tests 1.11.x 🐞 / PHP 7.4 Test on ubuntu-latest (push) Canceled after 0s
PHP-CS-Fixer / composer_install (7.4) (push) Canceled after 0s
Chamilo 1.11.40 (ZIP oficial v1.11.40)
Fuente: https://github.com/chamilo/chamilo-lms/releases/download/v1.11.40/chamilo-1.11.40.zip
sha256: 1cf4bf2cc7bae1ef1a1eff643235db1d552f78ddf4b6dd1e2d2dac9868679439
Snapshot independiente (rama huerfana); diffable vs 1.11.38. vendor incluido.
2026-08-06 17:59:45 +02:00

2.1 KiB

UPGRADE

Upgrading from 1.x to 2.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.

Upgrading from 0.3 to 0.4

  • 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 the php-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 the provide section of their composer.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 the php-xapi/serializer package.

  • The SerializerRegistry class is now final. If you need custom behavior inside the serializer registry, create your own implementation of the SerializerRegistryInterface.