1 | <?php |
||
30 | class SubmoduleCommand extends BaseCommand |
||
31 | { |
||
32 | public const SUBMODULE_COMMAND = 'submodule'; |
||
33 | public const SUBMODULE_ADD_COMMAND = 'add'; |
||
34 | public const SUBMODULE_INIT_COMMAND = 'init'; |
||
35 | public const SUBMODULE_UPDATE_COMMAND = 'update'; |
||
36 | public const SUBMODULE_OPTION_FORCE = '--force'; |
||
37 | public const SUBMODULE_OPTION_INIT = '--init'; |
||
38 | public const SUBMODULE_OPTION_RECURSIVE = '--recursive'; |
||
39 | |||
40 | /** |
||
41 | * constructor |
||
42 | * |
||
43 | * @param \GitElephant\Repository $repo The repository object this command |
||
44 | * will interact with |
||
45 | */ |
||
46 | 1 | public function __construct(Repository $repo = null) |
|
50 | |||
51 | /** |
||
52 | * add a submodule |
||
53 | * |
||
54 | * @param string $gitUrl git url of the submodule |
||
55 | * @param string $path path to register the submodule to |
||
56 | * |
||
57 | * @throws \RuntimeException |
||
58 | * @return string |
||
59 | */ |
||
60 | 1 | public function add($gitUrl, $path = null): string |
|
71 | |||
72 | /** |
||
73 | * initialize a repository's submodules |
||
74 | * |
||
75 | * @param string $path init only submodules at the specified path |
||
76 | * |
||
77 | * @return string |
||
78 | */ |
||
79 | public function init($path = null): string |
||
89 | |||
90 | /** |
||
91 | * Lists submodules |
||
92 | * |
||
93 | * @throws \RuntimeException |
||
94 | * @return string the command |
||
95 | */ |
||
96 | public function listSubmodules(): string |
||
103 | |||
104 | /** |
||
105 | * Lists submodules |
||
106 | * |
||
107 | * @deprecated This method uses an unconventional name but is being left in |
||
108 | * place to remain compatible with existing code relying on it. |
||
109 | * New code should be written to use listSubmodules(). |
||
110 | * |
||
111 | * @throws \RuntimeException |
||
112 | * @return string the command |
||
113 | */ |
||
114 | public function lists(): string |
||
118 | |||
119 | /** |
||
120 | * update a repository's submodules |
||
121 | * |
||
122 | * @param bool $recursive update recursively |
||
123 | * @param bool $init init before update |
||
124 | * @param bool $force force the checkout as part of update |
||
125 | * @param string $path update only a specific submodule path |
||
126 | * |
||
127 | * @return string |
||
128 | */ |
||
129 | public function update( |
||
152 | } |
||
153 |