Changeset View
Changeset View
Standalone View
Standalone View
src/toolset/ArcanistWorkflowArgument.php
<?php | <?php | ||||
final class ArcanistWorkflowArgument | final class ArcanistWorkflowArgument | ||||
extends Phobject { | extends Phobject { | ||||
private $key; | private $key; | ||||
private $help; | private $help; | ||||
private $wildcard; | private $wildcard; | ||||
private $parameter; | private $parameter; | ||||
private $isPathArgument; | private $isPathArgument; | ||||
private $shortFlag; | |||||
private $repeatable; | |||||
public function setKey($key) { | public function setKey($key) { | ||||
$this->key = $key; | $this->key = $key; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function getKey() { | public function getKey() { | ||||
return $this->key; | return $this->key; | ||||
} | } | ||||
public function setWildcard($wildcard) { | public function setWildcard($wildcard) { | ||||
$this->wildcard = $wildcard; | $this->wildcard = $wildcard; | ||||
return $this; | return $this; | ||||
} | } | ||||
public function getWildcard() { | public function getWildcard() { | ||||
return $this->wildcard; | return $this->wildcard; | ||||
} | } | ||||
public function setShortFlag($short_flag) { | |||||
$this->shortFlag = $short_flag; | |||||
return $this; | |||||
} | |||||
public function getShortFlag() { | |||||
return $this->shortFlag; | |||||
} | |||||
public function setRepeatable($repeatable) { | |||||
$this->repeatable = $repeatable; | |||||
return $this; | |||||
} | |||||
public function getRepeatable() { | |||||
return $this->repeatable; | |||||
} | |||||
public function getPhutilSpecification() { | public function getPhutilSpecification() { | ||||
$spec = array( | $spec = array( | ||||
'name' => $this->getKey(), | 'name' => $this->getKey(), | ||||
); | ); | ||||
if ($this->getWildcard()) { | if ($this->getWildcard()) { | ||||
$spec['wildcard'] = true; | $spec['wildcard'] = true; | ||||
} | } | ||||
$parameter = $this->getParameter(); | $parameter = $this->getParameter(); | ||||
if ($parameter !== null) { | if ($parameter !== null) { | ||||
$spec['param'] = $parameter; | $spec['param'] = $parameter; | ||||
} | } | ||||
$help = $this->getHelp(); | $help = $this->getHelp(); | ||||
if ($help !== null) { | if ($help !== null) { | ||||
$spec['help'] = $help; | $spec['help'] = $help; | ||||
} | } | ||||
$short = $this->getShortFlag(); | |||||
if ($short !== null) { | |||||
$spec['short'] = $short; | |||||
} | |||||
$repeatable = $this->getRepeatable(); | |||||
if ($repeatable !== null) { | |||||
$spec['repeat'] = $repeatable; | |||||
} | |||||
return $spec; | return $spec; | ||||
} | } | ||||
public function setHelp($help) { | public function setHelp($help) { | ||||
$this->help = $help; | $this->help = $help; | ||||
return $this; | return $this; | ||||
} | } | ||||
Show All 23 Lines |