Changeset View
Changeset View
Standalone View
Standalone View
src/hardpoint/ArcanistHardpointRequest.php
Show All 10 Lines | final class ArcanistHardpointRequest | ||||
private $isComplete; | private $isComplete; | ||||
public static function newFromSpecification($spec) { | public static function newFromSpecification($spec) { | ||||
if ($spec instanceof ArcanistHardpointRequest) { | if ($spec instanceof ArcanistHardpointRequest) { | ||||
return $spec; | return $spec; | ||||
} | } | ||||
if (is_string($spec)) { | if (is_string($spec)) { | ||||
return id(new self())->setHardpoint($spec); | return (new self())->setHardpoint($spec); | ||||
} | } | ||||
throw new Exception( | throw new Exception( | ||||
pht( | pht( | ||||
'Unknown Hardpoint request specification (of type "%s").', | 'Unknown Hardpoint request specification (of type "%s").', | ||||
phutil_describe_type($spec))); | phutil_describe_type($spec))); | ||||
} | } | ||||
Show All 20 Lines | public function setObjects(array $objects) { | ||||
return $this; | return $this; | ||||
} | } | ||||
public function getObjects() { | public function getObjects() { | ||||
return $this->objects; | return $this->objects; | ||||
} | } | ||||
public function newTask() { | public function newTask() { | ||||
$task = id(new ArcanistHardpointTask()) | $task = (new ArcanistHardpointTask()) | ||||
->setRequest($this); | ->setRequest($this); | ||||
$this->tasks[] = $task; | $this->tasks[] = $task; | ||||
$this->isComplete = false; | $this->isComplete = false; | ||||
return $task; | return $task; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 68 Lines • Show Last 20 Lines |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0