Merge "rest: Return a 400 for invalid render IDs"
[mediawiki.git] / includes / content / ValidationParams.php
blobe1321ac83fa1e9373cc90dd137a552de8e344236
1 <?php
2 namespace MediaWiki\Content;
4 use MediaWiki\Page\PageIdentity;
6 /**
7 * @since 1.38
8 * An object to hold validation params.
9 */
10 class ValidationParams {
11 /** @var PageIdentity */
12 private $pageIdentity;
14 /** @var int */
15 private $flags;
17 /** @var int */
18 private $parentRevId;
20 public function __construct( PageIdentity $pageIdentity, int $flags, int $parentRevId = -1 ) {
21 $this->pageIdentity = $pageIdentity;
22 $this->flags = $flags;
23 $this->parentRevId = $parentRevId;
26 public function getPageIdentity(): PageIdentity {
27 return $this->pageIdentity;
30 public function getFlags(): int {
31 return $this->flags;
34 /**
35 * @deprecated since 1.38. Born soft-deprecated as we will move usage of it
36 * to MultiContentSaveHook in ProofreadPage (only one place of usage).
38 * @return int
40 public function getParentRevisionId(): int {
41 return $this->parentRevId;