Differential D8468 Diff 20121 src/applications/differential/field/specification/DifferentialTestPlanFieldSpecification.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/differential/field/specification/DifferentialTestPlanFieldSpecification.php
| <?php | <?php | ||||
| final class DifferentialTestPlanFieldSpecification | final class DifferentialTestPlanFieldSpecification | ||||
| extends DifferentialFieldSpecification { | extends DifferentialFieldSpecification { | ||||
| private $plan = ''; | private $plan = ''; | ||||
| // NOTE: This means "uninitialized". | // NOTE: This means "uninitialized". | ||||
| private $error = false; | private $error = false; | ||||
| public function shouldAppearOnEdit() { | public function shouldAppearOnEdit() { | ||||
| return PhabricatorEnv::getEnvConfig('differential.show-test-plan-field'); | return false; | ||||
| } | } | ||||
| protected function didSetRevision() { | protected function didSetRevision() { | ||||
| $this->plan = (string)$this->getRevision()->getTestPlan(); | $this->plan = (string)$this->getRevision()->getTestPlan(); | ||||
| } | } | ||||
| public function setValueFromRequest(AphrontRequest $request) { | public function setValueFromRequest(AphrontRequest $request) { | ||||
| $this->plan = $request->getStr('testplan'); | $this->plan = $request->getStr('testplan'); | ||||
| Show All 27 Lines | if ($this->isRequired()) { | ||||
| $this->error = 'Required'; | $this->error = 'Required'; | ||||
| throw new DifferentialFieldValidationException( | throw new DifferentialFieldValidationException( | ||||
| "You must provide a test plan."); | "You must provide a test plan."); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| public function shouldAppearOnCommitMessage() { | public function shouldAppearOnCommitMessage() { | ||||
| return PhabricatorEnv::getEnvConfig('differential.show-test-plan-field'); | return false; | ||||
| } | } | ||||
| public function getCommitMessageKey() { | public function getCommitMessageKey() { | ||||
| return 'testPlan'; | return 'testPlan'; | ||||
| } | } | ||||
| public function setValueFromParsedCommitMessage($value) { | public function setValueFromParsedCommitMessage($value) { | ||||
| $this->plan = (string)$value; | $this->plan = (string)$value; | ||||
| ▲ Show 20 Lines • Show All 48 Lines • Show Last 20 Lines | |||||