| 1 |
<?php |
| 2 |
|
| 3 |
namespace MediaWiki\Extension\AbuseFilter\Parser; |
| 4 |
|
| 5 |
use MediaWiki\Extension\AbuseFilter\Parser\Exception\ExceptionBase; |
| 6 |
use MediaWiki\Extension\AbuseFilter\Parser\Exception\UserVisibleWarning; |
| 7 |
|
| 8 |
class ParserStatus { |
| 9 |
|
| 10 |
protected $excep; |
| 11 |
|
| 12 |
protected $warnings; |
| 13 |
|
| 14 |
protected $condsUsed; |
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
public function __construct( |
| 22 |
?ExceptionBase $excep, |
| 23 |
array $warnings, |
| 24 |
int $condsUsed |
| 25 |
) { |
| 26 |
$this->excep = $excep; |
| 27 |
$this->warnings = $warnings; |
| 28 |
$this->condsUsed = $condsUsed; |
| 29 |
} |
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
public function getException(): ?ExceptionBase { |
| 35 |
return $this->excep; |
| 36 |
} |
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
public function getWarnings(): array { |
| 42 |
return $this->warnings; |
| 43 |
} |
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
public function getCondsUsed(): int { |
| 49 |
return $this->condsUsed; |
| 50 |
} |
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
public function isValid(): bool { |
| 57 |
return !$this->excep; |
| 58 |
} |
| 59 |
} |