| 1 | <?php |
||
| 10 | class Git extends Command |
||
| 11 | { |
||
| 12 | |||
| 13 | /** @var string */ |
||
| 14 | private $gitExecutable = 'git'; |
||
| 15 | |||
| 16 | private $command; |
||
| 17 | |||
| 18 | |||
| 19 | /** |
||
| 20 | * @return string |
||
| 21 | */ |
||
| 22 | 1 | public function getGitExecutable() |
|
| 23 | { |
||
| 24 | 1 | return $this->gitExecutable; |
|
| 25 | } |
||
| 26 | |||
| 27 | |||
| 28 | /** |
||
| 29 | * @param string $gitExecutable |
||
| 30 | */ |
||
| 31 | 2 | public function setGitExecutable($gitExecutable) |
|
| 32 | { |
||
| 33 | 2 | if ($gitExecutable == '') { |
|
| 34 | 1 | throw new \InvalidArgumentException("Git executable cannot be empty."); |
|
| 35 | } |
||
| 36 | 1 | $this->gitExecutable = $gitExecutable; |
|
| 37 | 1 | } |
|
| 38 | |||
| 39 | |||
| 40 | /** |
||
| 41 | * @return mixed |
||
| 42 | */ |
||
| 43 | 1 | public function getCommand() |
|
| 44 | { |
||
| 45 | 1 | return $this->command; |
|
| 46 | } |
||
| 47 | |||
| 48 | |||
| 49 | /** |
||
| 50 | * @param mixed $command |
||
| 51 | */ |
||
| 52 | 2 | public function setCommand($command) |
|
| 56 | |||
| 57 | |||
| 58 | public function cloneRepo($url, $branch = NULL, $dir = NULL) |
||
| 66 | |||
| 67 | |||
| 68 | 1 | public function execute() |
|
| 72 | |||
| 73 | |||
| 74 | 1 | private function exec($command) |
|
| 80 | |||
| 81 | } |