| 1 |
<?php |
| 2 |
|
| 3 |
namespace MediaWiki\Extension\AbuseFilter\Filter; |
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
class Filter extends AbstractFilter { |
| 10 |
|
| 11 |
protected $lastEditInfo; |
| 12 |
|
| 13 |
protected $id; |
| 14 |
|
| 15 |
protected $hitCount; |
| 16 |
|
| 17 |
protected $throttled; |
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
public function __construct( |
| 30 |
Specs $specs, |
| 31 |
Flags $flags, |
| 32 |
$actions, |
| 33 |
LastEditInfo $lastEditInfo, |
| 34 |
?int $id = null, |
| 35 |
?int $hitCount = null, |
| 36 |
?bool $throttled = null |
| 37 |
) { |
| 38 |
parent::__construct( $specs, $flags, $actions ); |
| 39 |
$this->lastEditInfo = clone $lastEditInfo; |
| 40 |
$this->id = $id; |
| 41 |
$this->hitCount = $hitCount; |
| 42 |
$this->throttled = $throttled; |
| 43 |
} |
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
public function getLastEditInfo(): LastEditInfo { |
| 49 |
return clone $this->lastEditInfo; |
| 50 |
} |
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
public function getID(): ?int { |
| 56 |
return $this->id; |
| 57 |
} |
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
public function getUserID(): int { |
| 63 |
return $this->lastEditInfo->getUserID(); |
| 64 |
} |
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
|
| 69 |
public function getUserName(): string { |
| 70 |
return $this->lastEditInfo->getUserName(); |
| 71 |
} |
| 72 |
|
| 73 |
|
| 74 |
|
| 75 |
|
| 76 |
public function getTimestamp(): string { |
| 77 |
return $this->lastEditInfo->getTimestamp(); |
| 78 |
} |
| 79 |
|
| 80 |
|
| 81 |
|
| 82 |
|
| 83 |
public function getHitCount(): ?int { |
| 84 |
return $this->hitCount; |
| 85 |
} |
| 86 |
|
| 87 |
|
| 88 |
|
| 89 |
|
| 90 |
public function isThrottled(): ?bool { |
| 91 |
return $this->throttled; |
| 92 |
} |
| 93 |
|
| 94 |
|
| 95 |
|
| 96 |
|
| 97 |
public function __clone() { |
| 98 |
parent::__clone(); |
| 99 |
$this->lastEditInfo = clone $this->lastEditInfo; |
| 100 |
} |
| 101 |
} |