2019-09-15 15:48:13 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace MediaWiki\Extension\AbuseFilter\Parser;
|
|
|
|
|
|
|
|
class ParserStatus {
|
|
|
|
/** @var bool */
|
|
|
|
private $result;
|
|
|
|
/** @var bool */
|
|
|
|
private $warmCache;
|
|
|
|
/** @var AFPException|null */
|
|
|
|
private $excep;
|
2020-12-18 16:53:36 +00:00
|
|
|
/** @var UserVisibleWarning[] */
|
|
|
|
private $warnings;
|
2019-09-15 15:48:13 +00:00
|
|
|
|
|
|
|
/**
|
2020-12-18 16:53:36 +00:00
|
|
|
* @param bool $result A generic operation result
|
2019-09-15 15:48:13 +00:00
|
|
|
* @param bool $warmCache Whether we retrieved the AST from cache
|
|
|
|
* @param AFPException|null $excep An exception thrown while parsing, or null if it parsed correctly
|
2020-12-18 16:53:36 +00:00
|
|
|
* @param UserVisibleWarning[] $warnings
|
2019-09-15 15:48:13 +00:00
|
|
|
*/
|
2020-12-18 16:53:36 +00:00
|
|
|
public function __construct( bool $result, bool $warmCache, ?AFPException $excep, array $warnings ) {
|
2019-09-15 15:48:13 +00:00
|
|
|
$this->result = $result;
|
|
|
|
$this->warmCache = $warmCache;
|
|
|
|
$this->excep = $excep;
|
2020-12-18 16:53:36 +00:00
|
|
|
$this->warnings = $warnings;
|
2019-09-15 15:48:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return bool
|
|
|
|
*/
|
|
|
|
public function getResult() : bool {
|
|
|
|
return $this->result;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return bool
|
|
|
|
*/
|
|
|
|
public function getWarmCache() : bool {
|
|
|
|
return $this->warmCache;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @return AFPException|null
|
|
|
|
*/
|
|
|
|
public function getException() : ?AFPException {
|
|
|
|
return $this->excep;
|
|
|
|
}
|
2020-12-18 16:53:36 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @return UserVisibleWarning[]
|
|
|
|
*/
|
|
|
|
public function getWarnings() : array {
|
|
|
|
return $this->warnings;
|
|
|
|
}
|
2019-09-15 15:48:13 +00:00
|
|
|
}
|