+
+ /**
+ * Set a factory function to create an EditConflictHelper
+ *
+ * @param callable $factory Factory function
+ * @since 1.31
+ */
+ public function setEditConflictHelperFactory( callable $factory ) {
+ $this->editConflictHelperFactory = $factory;
+ $this->editConflictHelper = null;
+ }
+
+ /**
+ * @return TextConflictHelper
+ */
+ private function getEditConflictHelper() {
+ if ( !$this->editConflictHelper ) {
+ $this->editConflictHelper = call_user_func(
+ $this->editConflictHelperFactory,
+ $this->getSubmitButtonLabel()
+ );
+ }
+
+ return $this->editConflictHelper;
+ }
+
+ /**
+ * @param string $submitButtonLabel
+ * @return TextConflictHelper
+ */
+ private function newTextConflictHelper( $submitButtonLabel ) {
+ return new TextConflictHelper(
+ $this->getTitle(),
+ $this->getContext()->getOutput(),
+ MediaWikiServices::getInstance()->getStatsdDataFactory(),
+ $submitButtonLabel
+ );
+ }