diff --git a/src/applications/people/PhabricatorUserEditor.php b/src/applications/people/PhabricatorUserEditor.php index 9f811e42c5..ec734cc6b9 100644 --- a/src/applications/people/PhabricatorUserEditor.php +++ b/src/applications/people/PhabricatorUserEditor.php @@ -75,7 +75,7 @@ final class PhabricatorUserEditor extends PhabricatorEditor { } $log = PhabricatorUserLog::newLog( - $this->getActor(), + $this->requireActor(), $user, PhabricatorUserLog::ACTION_CREATE); $log->setNewValue($email->getAddress()); @@ -97,7 +97,6 @@ final class PhabricatorUserEditor extends PhabricatorEditor { throw new Exception("User has not been created yet!"); } - $actor = $this->requireActor(); $user->openTransaction(); $user->save(); if ($email) { @@ -105,7 +104,7 @@ final class PhabricatorUserEditor extends PhabricatorEditor { } $log = PhabricatorUserLog::newLog( - $actor, + $this->requireActor(), $user, PhabricatorUserLog::ACTION_EDIT); $log->save(); @@ -134,7 +133,7 @@ final class PhabricatorUserEditor extends PhabricatorEditor { $user->save(); $log = PhabricatorUserLog::newLog( - $this->getActor(), + $this->requireActor(), $user, PhabricatorUserLog::ACTION_CHANGE_PASSWORD); $log->save(); diff --git a/src/infrastructure/PhabricatorEditor.php b/src/infrastructure/PhabricatorEditor.php index df6e901541..d92322b999 100644 --- a/src/infrastructure/PhabricatorEditor.php +++ b/src/infrastructure/PhabricatorEditor.php @@ -16,18 +16,20 @@ * limitations under the License. */ -abstract class PhabricatorEditor { +abstract class PhabricatorEditor extends Phobject { private $actor; private $excludeMailRecipientPHIDs = array(); - final public function setActor(PhabricatorUser $user) { - $this->user = $user; + final public function setActor(PhabricatorUser $actor) { + $this->actor = $actor; return $this; } + final protected function getActor() { - return $this->user; + return $this->actor; } + final protected function requireActor() { $actor = $this->getActor(); if (!$actor) { @@ -40,6 +42,7 @@ abstract class PhabricatorEditor { $this->excludeMailRecipientPHIDs = $phids; return $this; } + final protected function getExcludeMailRecipientPHIDs() { return $this->excludeMailRecipientPHIDs; }