1 | <?php |
||
20 | class Repository |
||
21 | { |
||
22 | /** |
||
23 | * Path to git repository root |
||
24 | * |
||
25 | * @var string |
||
26 | */ |
||
27 | private $root; |
||
28 | |||
29 | /** |
||
30 | * Path to .git directory |
||
31 | * |
||
32 | * @var string |
||
33 | */ |
||
34 | private $dotGitDir; |
||
35 | |||
36 | /** |
||
37 | * Commit message data |
||
38 | * |
||
39 | * @var \sebastianfeldmann\CaptainHook\Git\CommitMessage |
||
40 | */ |
||
41 | private $commitMsg; |
||
42 | |||
43 | /** |
||
44 | * Resolver to get changed files |
||
45 | * |
||
46 | * @var \sebastianfeldmann\CaptainHook\Git\Resolver\ChangedFiles |
||
47 | */ |
||
48 | private $changedFilesResolver; |
||
49 | |||
50 | /** |
||
51 | * Repository constructor. |
||
52 | * |
||
53 | * @param string $root |
||
54 | */ |
||
55 | 28 | public function __construct($root = null) |
|
64 | |||
65 | /** |
||
66 | * Returns the path to the hooks directory. |
||
67 | * |
||
68 | * @return string |
||
69 | */ |
||
70 | 4 | public function getHooksDir() |
|
74 | |||
75 | /** |
||
76 | * Check for a hook file. |
||
77 | * |
||
78 | * @param string $hook |
||
79 | * @return bool |
||
80 | */ |
||
81 | 3 | public function hookExists($hook) |
|
85 | |||
86 | /** |
||
87 | * CommitMessage setter. |
||
88 | * |
||
89 | * @param \sebastianfeldmann\CaptainHook\Git\CommitMessage $commitMsg |
||
90 | */ |
||
91 | 8 | public function setCommitMsg(CommitMessage $commitMsg) |
|
95 | |||
96 | /** |
||
97 | * CommitMessage getter. |
||
98 | * |
||
99 | * @return \sebastianfeldmann\CaptainHook\Git\CommitMessage |
||
100 | */ |
||
101 | 7 | public function getCommitMsg() |
|
108 | |||
109 | /** |
||
110 | * Get changed file resolver. |
||
111 | * |
||
112 | * @return \sebastianfeldmann\CaptainHook\Git\Resolver\ChangedFiles |
||
113 | */ |
||
114 | 1 | public function getChangedFilesResolver() |
|
121 | |||
122 | /** |
||
123 | * Is there a merge in progress. |
||
124 | * |
||
125 | * @return bool |
||
126 | */ |
||
127 | 4 | public function isMerging() |
|
136 | } |
||
137 |