1 | <?php |
||
14 | class HandleExistingFile |
||
15 | { |
||
16 | |||
17 | /** |
||
18 | * @param string $originalTest |
||
19 | * @param string $newTest |
||
20 | * @throws Exception |
||
21 | * @return string |
||
22 | */ |
||
23 | private function replaceHeaderOnly($originalTest, $newTest) |
||
24 | { |
||
25 | if (!preg_match('/^.*?}/s', $newTest, $matches)) { |
||
26 | throw new Exception('No header found in new test'); |
||
27 | } |
||
28 | |||
29 | $header = $matches[0]; |
||
30 | |||
31 | return preg_replace('/^.*?}/s', $header, $originalTest); |
||
32 | } |
||
33 | |||
34 | |||
35 | /** |
||
36 | * @param string $originalTest |
||
37 | * @param string $newTest |
||
38 | * @param OutputInterface $output |
||
39 | * @todo finish |
||
|
|||
40 | */ |
||
41 | private function displayPatch($originalTest, $newTest, OutputInterface $output) |
||
45 | |||
46 | /** |
||
47 | * @param InputInterface $input |
||
48 | * @param OutputInterface $output |
||
49 | * @param QuestionHelper $helper |
||
50 | * @param string $serviceId |
||
51 | * @param string $testFileName |
||
52 | * @param string $template |
||
53 | * @return string |
||
54 | * @throws Exception |
||
55 | */ |
||
56 | public function handleExistingFile( |
||
87 | |||
88 | /** |
||
89 | * @param OutputInterface $output |
||
90 | * @param $template |
||
91 | * @param $answerId |
||
92 | * @param $originalTest |
||
93 | * @return bool|string |
||
94 | * @throws Exception |
||
95 | */ |
||
96 | private function handleQuestion(OutputInterface $output, string $template, string $answerId, $originalTest) |
||
114 | } |
||
115 |
This check looks
TODO
comments that have been left in the code.``TODO``s show that something is left unfinished and should be attended to.