Parsoid
A bidirectional parser between wikitext and HTML5
Loading...
Searching...
No Matches
Wikimedia\Parsoid\Utils\CompatJsonCodec Class Reference

This is a "compatible" JSON codec for the use of Parsoid test runners, etc. More...

+ Inheritance diagram for Wikimedia\Parsoid\Utils\CompatJsonCodec:
+ Collaboration diagram for Wikimedia\Parsoid\Utils\CompatJsonCodec:

Protected Member Functions

 codecFor (string $className)
 

Detailed Description

This is a "compatible" JSON codec for the use of Parsoid test runners, etc.

In addition to supporting objects which implement JsonCodecable, it tries to handle objects we might get from mediawiki-core which implement JsonSerializable and other legacy serialization types.

This should not be relied on for production!

However, it is good enough to use in test cases, etc, and hopefully makes them a little bit less fragile by not blowing up if it gets a martian object from mediawiki-core stuck into the parser's extension data.

Member Function Documentation

◆ codecFor()

Wikimedia\Parsoid\Utils\CompatJsonCodec::codecFor ( string $className)
protected

Parameters
class-string$className
array$json
Returns
never

The documentation for this class was generated from the following file: