Wikibase
MediaWiki Wikibase extension
Wikibase\Repo\ChangeOp\Deserialization\TermChangeOpSerializationValidator Class Reference

This class is used to validate attributes of term change serializations such as language fields before they are passed to ChangeOps. More...

Public Member Functions

 __construct (ContentLanguages $termsLanguages)
 
 validateTermSerialization ( $serialization, $languageCode)
 

Private Member Functions

 throwException ( $message, $errorCode)
 
 assertArray ( $value, $message)
 
 assertString ( $value, $message)
 
 assertType ( $type, $value, $message)
 

Private Attributes

 $termsLanguages
 

Detailed Description

This class is used to validate attributes of term change serializations such as language fields before they are passed to ChangeOps.

Constructor & Destructor Documentation

◆ __construct()

Wikibase\Repo\ChangeOp\Deserialization\TermChangeOpSerializationValidator::__construct ( ContentLanguages  $termsLanguages)

Member Function Documentation

◆ assertArray()

Wikibase\Repo\ChangeOp\Deserialization\TermChangeOpSerializationValidator::assertArray (   $value,
  $message 
)
private
Parameters
mixed$value
string$message

◆ assertString()

Wikibase\Repo\ChangeOp\Deserialization\TermChangeOpSerializationValidator::assertString (   $value,
  $message 
)
private
Parameters
mixed$value
string$message

◆ assertType()

Wikibase\Repo\ChangeOp\Deserialization\TermChangeOpSerializationValidator::assertType (   $type,
  $value,
  $message 
)
private
Parameters
string$type
mixed$value
string$message

◆ throwException()

Wikibase\Repo\ChangeOp\Deserialization\TermChangeOpSerializationValidator::throwException (   $message,
  $errorCode 
)
private
Parameters
string$message
string$errorCode
Exceptions
ChangeOpDeserializationException

◆ validateTermSerialization()

Wikibase\Repo\ChangeOp\Deserialization\TermChangeOpSerializationValidator::validateTermSerialization (   $serialization,
  $languageCode 
)
Parameters
string[]$serializationTerm serialization array
int | string$languageCodeKey from the term list array, related to $serialization. If a string its value must match $serialization['language'].
See also
md_docs_topics_changeop-serializations for information on term serialization format
Exceptions
ChangeOpDeserializationException

Member Data Documentation

◆ $termsLanguages

Wikibase\Repo\ChangeOp\Deserialization\TermChangeOpSerializationValidator::$termsLanguages
private

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