1 | <?php |
||
32 | class Caller extends AbstractCaller |
||
33 | { |
||
34 | /** |
||
35 | * the repository path |
||
36 | * |
||
37 | * @var string |
||
38 | */ |
||
39 | private $repositoryPath; |
||
40 | |||
41 | /** |
||
42 | * Class constructor |
||
43 | * |
||
44 | * @param string|null $gitPath the physical path to the git binary |
||
45 | * @param string $repositoryPath the physical base path for the repository |
||
46 | */ |
||
47 | 108 | public function __construct($gitPath, $repositoryPath) |
|
59 | |||
60 | /** |
||
61 | * Executes a command |
||
62 | * |
||
63 | * @param string $cmd the command to execute |
||
64 | * @param bool $git if the command is git or a generic command |
||
65 | * @param string $cwd the directory where the command must be executed |
||
66 | * @param array $acceptedExitCodes exit codes accepted to consider the command execution successful |
||
67 | * |
||
68 | * @throws \RuntimeException |
||
69 | * @throws \Symfony\Component\Process\Exception\InvalidArgumentException |
||
70 | * @throws \Symfony\Component\Process\Exception\ProcessTimedOutException |
||
71 | * @throws \Symfony\Component\Process\Exception\RuntimeException |
||
72 | * @throws \Symfony\Component\Process\Exception\LogicException |
||
73 | * @return Caller |
||
74 | */ |
||
75 | 103 | public function execute( |
|
118 | |||
119 | /** |
||
120 | * returns the output of the last executed command |
||
121 | * |
||
122 | * @return string |
||
123 | */ |
||
124 | 7 | public function getOutput(): string |
|
128 | |||
129 | /** |
||
130 | * returns the output of the last executed command as an array of lines |
||
131 | * |
||
132 | * @param bool $stripBlankLines remove the blank lines |
||
133 | * |
||
134 | * @return array |
||
135 | */ |
||
136 | 92 | public function getOutputLines(bool $stripBlankLines = false): array |
|
151 | |||
152 | /** |
||
153 | * Get RawOutput |
||
154 | * |
||
155 | * @return string |
||
156 | */ |
||
157 | 1 | public function getRawOutput(): string |
|
161 | } |
||
162 |