Last modified: 2013-06-26 12:13:10 UTC
SerializerFactory::newSerializerForObject optionally takes a SerializationOptions object. EntitySerializer however requires an EntitySerializerObject. Scribunto_LuaWikibaseLibrary calls newSerializerForObject with no options set, which causes a fatal error when trying to instantiate an EntitySerializer. The issue however is more general: If SerializerFactory takes a generic options object, but some of the serializers require a specialized options object, the caller of the factory function would have to know in advance what kind of object will be constructed. In fact, any knowledge about the needs and requirements of any of the objects the factory may create essentially renders the factory pointless. For the factory to be useful, it must only request very generic information from the caller.
https://gerrit.wikimedia.org/r/69676 (Gerrit Change I4762ad35a43cc2d6e3b8efae75762bcb782e33e2) | change APPROVED and MERGED [by jenkins-bot]
Verified Wikidata demo sprint 22-9