1 | <?php |
||
30 | class BranchCommand extends BaseCommand |
||
31 | { |
||
32 | public const BRANCH_COMMAND = 'branch'; |
||
33 | |||
34 | /** |
||
35 | * constructor |
||
36 | * |
||
37 | * @param \GitElephant\Repository $repo The repository object this command |
||
38 | * will interact with |
||
39 | */ |
||
40 | 43 | public function __construct(Repository $repo = null) |
|
44 | |||
45 | /** |
||
46 | * Locate branches that contain a reference |
||
47 | * |
||
48 | * @param string $reference reference |
||
49 | * |
||
50 | * @throws \RuntimeException |
||
51 | * @return string the command |
||
52 | */ |
||
53 | public function contains(string $reference): string |
||
62 | |||
63 | /** |
||
64 | * Create a new branch |
||
65 | * |
||
66 | * @param string $name The new branch name |
||
67 | * @param string|null $startPoint the new branch start point. |
||
68 | * |
||
69 | * @throws \RuntimeException |
||
70 | * @return string the command |
||
71 | */ |
||
72 | 34 | public function create(string $name, string $startPoint = null): string |
|
83 | |||
84 | /** |
||
85 | * Lists branches |
||
86 | * |
||
87 | * @param bool $all lists all remotes |
||
88 | * @param bool $simple list only branch names |
||
89 | * |
||
90 | * @throws \RuntimeException |
||
91 | * @return string the command |
||
92 | */ |
||
93 | 43 | public function listBranches(bool $all = false, bool $simple = false): string |
|
108 | |||
109 | /** |
||
110 | * Lists branches |
||
111 | * |
||
112 | * @deprecated This method uses an unconventional name but is being left in |
||
113 | * place to remain compatible with existing code relying on it. |
||
114 | * New code should be written to use listBranches(). |
||
115 | * |
||
116 | * @param bool $all lists all remotes |
||
117 | * @param bool $simple list only branch names |
||
118 | * |
||
119 | * @throws \RuntimeException |
||
120 | * @return string the command |
||
121 | */ |
||
122 | 1 | public function lists($all = false, bool $simple = false): string |
|
126 | |||
127 | /** |
||
128 | * get info about a single branch |
||
129 | * |
||
130 | * @param string $name The branch name |
||
131 | * @param bool $all lists all remotes |
||
132 | * @param bool $simple list only branch names |
||
133 | * @param bool $verbose verbose, show also the upstream branch |
||
134 | * |
||
135 | * @throws \RuntimeException |
||
136 | * @return string |
||
137 | */ |
||
138 | 1 | public function singleInfo(string $name, bool $all = false, bool $simple = false, bool $verbose = false): string |
|
158 | |||
159 | /** |
||
160 | * Delete a branch by its name |
||
161 | * |
||
162 | * @param string $name The branch to delete |
||
163 | * @param bool $force Force the delete |
||
164 | * |
||
165 | * @throws \RuntimeException |
||
166 | * @return string the command |
||
167 | */ |
||
168 | 1 | public function delete(string $name, bool $force = false): string |
|
178 | } |
||
179 |