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(string $x, string $y, string $name, string $renamed = null) |
|
82 | |||
83 | /** |
||
84 | * @param string $x X section of the status --porcelain output |
||
85 | * @param string $y Y section of the status --porcelain output |
||
86 | * @param string $name file name |
||
87 | * @param string $renamed new file name (if renamed) |
||
88 | * |
||
89 | * @return StatusFile |
||
90 | */ |
||
91 | 8 | public static function create(string $x, string $y, string $name, string $renamed = null) |
|
95 | |||
96 | /** |
||
97 | * @return bool |
||
98 | */ |
||
99 | 5 | public function isRenamed() |
|
103 | |||
104 | /** |
||
105 | * Get Name |
||
106 | * |
||
107 | * @return string |
||
108 | */ |
||
109 | public function getName() |
||
113 | |||
114 | /** |
||
115 | * Get the status of the index |
||
116 | * |
||
117 | * @return string |
||
118 | */ |
||
119 | 5 | public function getIndexStatus() |
|
123 | |||
124 | /** |
||
125 | * Get the status of the working tree |
||
126 | * |
||
127 | * @return string |
||
128 | */ |
||
129 | 6 | public function getWorkingTreeStatus() |
|
133 | |||
134 | /** |
||
135 | * description of the status |
||
136 | * |
||
137 | * @return string |
||
138 | */ |
||
139 | 1 | public function calculateDescription() |
|
171 | |||
172 | /** |
||
173 | * Set Description |
||
174 | * |
||
175 | * @param string $description the description variable |
||
176 | */ |
||
177 | public function setDescription(string $description) |
||
181 | |||
182 | /** |
||
183 | * Get Description |
||
184 | * |
||
185 | * @return string |
||
186 | */ |
||
187 | 1 | public function getDescription() |
|
194 | |||
195 | /** |
||
196 | * Set Type |
||
197 | * |
||
198 | * @param string $type the type variable |
||
199 | */ |
||
200 | public function setType(string $type) |
||
204 | |||
205 | /** |
||
206 | * Get Type |
||
207 | * |
||
208 | * @return string |
||
209 | */ |
||
210 | public function getType() |
||
214 | } |
||
215 |