Update method name in ContentHandler, soft-deprecate method on Content. This will require making a semi-backwards-incompatible change no matter what, we don't really have a great way of hard-deprecating overriding methods. Replace all callers of Content::prepareSave in core. Add tests for ContentHandler::validateSave. Bug: T287159 Change-Id: I7f23e6e97b1c7d27a6aaefdb88b19b2fc6e8b3a8
51 lines
961 B
PHP
51 lines
961 B
PHP
<?php
|
|
namespace MediaWiki\Content;
|
|
|
|
use MediaWiki\Page\PageIdentity;
|
|
|
|
/**
|
|
* @since 1.38
|
|
* An object to hold validation params.
|
|
*/
|
|
class ValidationParams {
|
|
/** @var PageIdentity */
|
|
private $pageIdentity;
|
|
|
|
/** @var int */
|
|
private $flags;
|
|
|
|
/** @var int */
|
|
private $parentRevId;
|
|
|
|
public function __construct( PageIdentity $pageIdentity, int $flags, int $parentRevId = -1 ) {
|
|
$this->pageIdentity = $pageIdentity;
|
|
$this->flags = $flags;
|
|
$this->parentRevId = $parentRevId;
|
|
}
|
|
|
|
/**
|
|
*
|
|
* @return PageIdentity
|
|
*/
|
|
public function getPageIdentity(): PageIdentity {
|
|
return $this->pageIdentity;
|
|
}
|
|
|
|
/**
|
|
*
|
|
* @return int
|
|
*/
|
|
public function getFlags(): int {
|
|
return $this->flags;
|
|
}
|
|
|
|
/**
|
|
* @deprecated since 1.38. Born soft-deprecated as we will move usage of it
|
|
* to MultiContentSaveHook in ProofreadPage (only one place of usage).
|
|
*
|
|
* @return int
|
|
*/
|
|
public function getParentRevisionId(): int {
|
|
return $this->parentRevId;
|
|
}
|
|
}
|