Correct a parameter order swap in "diffusion.historyquery" for Mercurial
[phabricator.git] / src / applications / transactions / editengine / PhabricatorEditEngineMFAEngine.php
blob271ec6f4460c835a4978adb372c84e4e6cf14cbc
1 <?php
3 abstract class PhabricatorEditEngineMFAEngine
4 extends Phobject {
6 private $object;
7 private $viewer;
9 public function setObject(PhabricatorEditEngineMFAInterface $object) {
10 $this->object = $object;
11 return $this;
14 public function getObject() {
15 return $this->object;
18 public function setViewer(PhabricatorUser $viewer) {
19 $this->viewer = $viewer;
20 return $this;
23 public function getViewer() {
24 if (!$this->viewer) {
25 throw new PhutilInvalidStateException('setViewer');
28 return $this->viewer;
31 final public static function newEngineForObject(
32 PhabricatorEditEngineMFAInterface $object) {
33 return $object->newEditEngineMFAEngine()
34 ->setObject($object);
37 /**
38 * Do edits to this object REQUIRE that the user submit MFA?
40 * This is a strict requirement: users will need to add MFA to their accounts
41 * if they don't already have it.
43 * @return bool True to strictly require MFA.
45 public function shouldRequireMFA() {
46 return false;
49 /**
50 * Should edits to this object prompt for MFA if it's available?
52 * This is advisory: users without MFA on their accounts will be able to
53 * perform edits without being required to add MFA.
55 * @return bool True to prompt for MFA if available.
57 public function shouldTryMFA() {
58 return false;