MediaWiki master
MediaWiki\Upload\UploadVerificationStatus Class Reference

A StatusValue for upload verification errors. More...

Inherits StatusValue, and StatusValue.

Collaboration diagram for MediaWiki\Upload\UploadVerificationStatus:

Public Member Functions

 asApiMessage ()
 
 getInvalidParameter ()
 
 isRecoverableError ()
 
 setApiCode (string $apiCode)
 
 setApiData (array $apiData)
 
 setInvalidParameter (string $invalidParameter)
 
 setRecoverableError (bool $recoverableError)
 
- Public Member Functions inherited from StatusValue
 __construct ()
 
 __toString ()
 Returns a string representation of the status for debugging.
 
 error ( $message,... $parameters)
 Add an error, do not set fatal flag This can be used for non-fatal errors.
 
 fatal ( $message,... $parameters)
 Add an error and set OK to false, indicating that the operation as a whole was fatal.
 
 getErrors ()
 Get the list of errors.
 
 getErrorsByType ( $type)
 Returns a list of status messages of the given type.
 
 getMessages (?string $type=null)
 Returns a list of error messages, optionally only those of the given type.
 
 getValue ()
 
 hasMessage (string $message)
 Returns true if the specified message is present as a warning or error.
 
 hasMessagesExcept (string ... $messages)
 Returns true if any other message than the specified ones is present as a warning or error.
 
 isGood ()
 Returns whether the operation completed and didn't have any error or warnings.
 
 isOK ()
 Returns whether the operation completed.
 
 merge ( $other, $overwriteValue=false)
 Merge another status object into this one.
 
 replaceMessage (string $source, $dest)
 If the specified source message exists, replace it with the specified destination message, but keep the same parameters as in the original error.
 
 setOK ( $ok)
 Change operation status.
 
 setResult ( $ok, $value=null)
 Change operation result.
 
 splitByErrorType ()
 Splits this StatusValue object into two new StatusValue objects, one which contains only the error messages, and one that contains the warnings, only.
 
 toJsonArray ()
 JSON serializing a StatusValue is possible only if the value and statusData are JSON-serializable, otherwise an InvalidArgumentException will be thrown.
 
 warning ( $message,... $parameters)
 Add a new warning.
 

Additional Inherited Members

- Static Public Member Functions inherited from StatusValue
static cast (StatusValue $sv)
 Succinct helper method to wrap a StatusValue in some other specific subclass.
 
static jsonClassHintFor (string $keyName)
 
static newFatal ( $message,... $parameters)
 Factory function for fatal errors.
 
static newFromJsonArray (array $json)
 
static newGood ( $value=null)
 Factory function for good results.
 
- Public Attributes inherited from StatusValue
int $failCount = 0
 Counter for batch operations.
 
mixed $statusData
 arbitrary extra data about the operation
 
bool[] $success = []
 Map of (key => bool) to indicate success of each part of batch operations.
 
int $successCount = 0
 Counter for batch operations.
 
T $value
 
- Protected Member Functions inherited from StatusValue
 getStatusArray ( $type=false)
 Returns a list of status messages of the given type (or all if false)
 
- Protected Attributes inherited from StatusValue
array[] $errors = []
 
bool $ok = true
 

Detailed Description

A StatusValue for upload verification errors.

This status will never have a value. It's only used to keep track of errors.

Stability: unstable
Since
1.44 <never>

Definition at line 22 of file UploadVerificationStatus.php.

Member Function Documentation

◆ asApiMessage()

MediaWiki\Upload\UploadVerificationStatus::asApiMessage ( )

Definition at line 57 of file UploadVerificationStatus.php.

◆ getInvalidParameter()

MediaWiki\Upload\UploadVerificationStatus::getInvalidParameter ( )

Definition at line 53 of file UploadVerificationStatus.php.

◆ isRecoverableError()

MediaWiki\Upload\UploadVerificationStatus::isRecoverableError ( )

Definition at line 49 of file UploadVerificationStatus.php.

◆ setApiCode()

MediaWiki\Upload\UploadVerificationStatus::setApiCode ( string $apiCode)

Definition at line 44 of file UploadVerificationStatus.php.

◆ setApiData()

MediaWiki\Upload\UploadVerificationStatus::setApiData ( array $apiData)

Definition at line 39 of file UploadVerificationStatus.php.

◆ setInvalidParameter()

MediaWiki\Upload\UploadVerificationStatus::setInvalidParameter ( string $invalidParameter)

Definition at line 34 of file UploadVerificationStatus.php.

◆ setRecoverableError()

MediaWiki\Upload\UploadVerificationStatus::setRecoverableError ( bool $recoverableError)

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