Changeset View
Changeset View
Standalone View
Standalone View
src/workflow/ArcanistWorkflow.php
Show First 20 Lines • Show All 962 Lines • ▼ Show 20 Lines | if (!$working_copy) { | ||||
"This workflow ('%s') requires a working copy, override ". | "This workflow ('%s') requires a working copy, override ". | ||||
"%s to return true.", | "%s to return true.", | ||||
$workflow, | $workflow, | ||||
'requiresWorkingCopy()')); | 'requiresWorkingCopy()')); | ||||
} | } | ||||
return $working_copy; | return $working_copy; | ||||
} | } | ||||
/** | |||||
* @param ArcanistRepositoryAPI<mixed> $api | |||||
* | |||||
* @return self<mixed> | |||||
*/ | |||||
final public function setRepositoryAPI($api) { | final public function setRepositoryAPI($api) { | ||||
$this->repositoryAPI = $api; | $this->repositoryAPI = $api; | ||||
return $this; | return $this; | ||||
} | } | ||||
final public function hasRepositoryAPI() { | final public function hasRepositoryAPI() { | ||||
try { | try { | ||||
return (bool)$this->getRepositoryAPI(); | return (bool)$this->getRepositoryAPI(); | ||||
} catch (Exception $ex) { | } catch (Exception $ex) { | ||||
return false; | return false; | ||||
} | } | ||||
} | } | ||||
/** | |||||
* @return ArcanistRepositoryAPI<mixed> | |||||
*/ | |||||
final public function getRepositoryAPI() { | final public function getRepositoryAPI() { | ||||
$configuration_engine = $this->getConfigurationEngine(); | $configuration_engine = $this->getConfigurationEngine(); | ||||
if ($configuration_engine) { | if ($configuration_engine) { | ||||
$working_copy = $configuration_engine->getWorkingCopy(); | $working_copy = $configuration_engine->getWorkingCopy(); | ||||
return $working_copy->getRepositoryAPI(); | return $working_copy->getRepositoryAPI(); | ||||
} | } | ||||
if (!$this->repositoryAPI) { | if (!$this->repositoryAPI) { | ||||
▲ Show 20 Lines • Show All 1,476 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