1 | <?php |
||
27 | class StatusFile |
||
28 | { |
||
29 | const UNTRACKED = '?'; |
||
30 | const IGNORED = '!'; |
||
31 | const UNMODIFIED = ''; |
||
32 | const MODIFIED = 'M'; |
||
33 | const ADDED = 'A'; |
||
34 | const DELETED = 'D'; |
||
35 | const RENAMED = 'R'; |
||
36 | const COPIED = 'C'; |
||
37 | const UPDATED_BUT_UNMERGED = 'U'; |
||
38 | |||
39 | /** |
||
40 | * @var string |
||
41 | */ |
||
42 | private $x; |
||
43 | |||
44 | /** |
||
45 | * @var string |
||
46 | */ |
||
47 | private $y; |
||
48 | |||
49 | /** |
||
50 | * @var string |
||
51 | */ |
||
52 | private $name; |
||
53 | |||
54 | /** |
||
55 | * @var string |
||
56 | */ |
||
57 | private $renamed; |
||
58 | |||
59 | /** |
||
60 | * @var string |
||
61 | */ |
||
62 | private $type; |
||
63 | |||
64 | /** |
||
65 | * @var string |
||
66 | */ |
||
67 | private $description; |
||
68 | |||
69 | /** |
||
70 | * @param string $x X section of the status --porcelain output |
||
71 | * @param string $y Y section of the status --porcelain output |
||
72 | * @param string $name file name |
||
73 | * @param string $renamed new file name (if renamed) |
||
74 | */ |
||
75 | 8 | private function __construct($x, $y, $name, $renamed) |
|
83 | |||
84 | /** |
||
85 | * @param string $x X section of the status --porcelain output |
||
86 | * @param string $y Y section of the status --porcelain output |
||
87 | * @param string $name file name |
||
88 | * @param string $renamed new file name (if renamed) |
||
89 | * |
||
90 | * @return StatusFile |
||
91 | */ |
||
92 | 8 | public static function create($x, $y, $name, $renamed) |
|
96 | |||
97 | /** |
||
98 | * @return bool |
||
99 | */ |
||
100 | 5 | public function isRenamed() |
|
104 | |||
105 | /** |
||
106 | * Get Name |
||
107 | * |
||
108 | * @return string |
||
109 | */ |
||
110 | public function getName() |
||
114 | |||
115 | /** |
||
116 | * Get the status of the index |
||
117 | * |
||
118 | * @return string |
||
119 | */ |
||
120 | 5 | public function getIndexStatus() |
|
124 | |||
125 | /** |
||
126 | * Get the status of the working tree |
||
127 | * |
||
128 | * @return string |
||
129 | */ |
||
130 | 6 | public function getWorkingTreeStatus() |
|
134 | |||
135 | /** |
||
136 | * description of the status |
||
137 | * |
||
138 | * @return string |
||
139 | */ |
||
140 | 8 | public function calculateDescription() |
|
172 | |||
173 | /** |
||
174 | * Set Description |
||
175 | * |
||
176 | * @param string $description the description variable |
||
177 | */ |
||
178 | public function setDescription($description) |
||
182 | |||
183 | /** |
||
184 | * Get Description |
||
185 | * |
||
186 | * @return string |
||
187 | */ |
||
188 | 1 | public function getDescription() |
|
192 | |||
193 | /** |
||
194 | * Set Type |
||
195 | * |
||
196 | * @param string $type the type variable |
||
197 | */ |
||
198 | public function setType($type) |
||
202 | |||
203 | /** |
||
204 | * Get Type |
||
205 | * |
||
206 | * @return string |
||
207 | */ |
||
208 | public function getType() |
||
212 | } |
||
213 |