@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
at upstream/main 23 lines 599 B view raw
1<?php 2 3final class DiffusionPreCommitContentPusherIsCommitterHeraldField 4 extends DiffusionPreCommitContentHeraldField { 5 6 const FIELDCONST = 'diffusion.pre.content.pusher.is-committer'; 7 8 public function getHeraldFieldName() { 9 return pht('Pusher is committer'); 10 } 11 12 public function getHeraldFieldValue($object) { 13 $pusher = $this->getAdapter()->getHookEngine()->getViewer()->getPHID(); 14 $committer = $this->getAdapter()->getCommitterPHID(); 15 16 return ($pusher === $committer); 17 } 18 19 protected function getHeraldFieldStandardType() { 20 return HeraldField::STANDARD_BOOL; 21 } 22 23}