Semantic MediaWiki and related extensions
Public Member Functions | Protected Member Functions | List of all members
SMW\Exception\JSONParseException Class Reference
Inheritance diagram for SMW\Exception\JSONParseException:
Inheritance graph
[legend]
Collaboration diagram for SMW\Exception\JSONParseException:
Collaboration graph
[legend]

Public Member Functions

 __construct ( $json)
 
 getTidyMessage ()
 

Protected Member Functions

 getParseError ( $json)
 

Detailed Description

GNU GPL v2+

Since
3.2
Author
mwjames

Constructor & Destructor Documentation

◆ __construct()

SMW\Exception\JSONParseException::__construct (   $json)
Since
3.2
Parameters
string$json

Member Function Documentation

◆ getParseError()

SMW\Exception\JSONParseException::getParseError (   $json)
protected

PHP has no built-in functionality to find errors in a JSON therefore we rely on JsonLint to help us find a more meaningful message other than "Syntax error".

JsonLint notes "... like json_decode() does, but slower, throws exceptions on failure." now that we failed we can take the performance penalty here and allow users to make an informed decision about the state of the JSON.

◆ getTidyMessage()

SMW\Exception\JSONParseException::getTidyMessage ( )
Since
3.2

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

About | General disclaimer | Privacy policy