Total Complexity | 7 |
Total Lines | 43 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
20 | class FindChangeHunkStartState implements State |
||
21 | { |
||
22 | /** |
||
23 | * @var FileMutationBuilder |
||
24 | */ |
||
25 | private $fileMutationBuilder; |
||
26 | |||
27 | /** |
||
28 | * FindChangeHunkStartState constructor. |
||
29 | */ |
||
30 | public function __construct(FileMutationBuilder $fileMutationBuilder) |
||
31 | { |
||
32 | $this->fileMutationBuilder = $fileMutationBuilder; |
||
33 | } |
||
34 | |||
35 | public function processLine(string $line): State |
||
36 | { |
||
37 | if (LineTypeDetector::isStartOfFileDiff($line)) { |
||
38 | return $this->processDiffStart(); |
||
39 | } |
||
40 | |||
41 | if (LineTypeDetector::isStartOfChangeHunk($line)) { |
||
42 | return $this->processChangeHunkStart($line); |
||
43 | } |
||
44 | |||
45 | return $this; |
||
46 | } |
||
47 | |||
48 | private function processDiffStart(): State |
||
53 | } |
||
54 | |||
55 | private function processChangeHunkStart(string $line): State |
||
56 | { |
||
57 | return new ChangeHunkParserState($this->fileMutationBuilder, $line); |
||
58 | } |
||
59 | |||
60 | public function finish(): void |
||
63 | } |
||
64 | } |
||
65 |