Conditions | 2 |
Paths | 2 |
Total Lines | 13 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
47 | public function execute(FormInterface $form) |
||
48 | { |
||
49 | $existentData = Yaml::parse(file_get_contents($this->yamlFile)); |
||
50 | $newData = [ |
||
51 | 'formType' => $form->getName(), |
||
52 | 'date' => (new \DateTimeImmutable())->format('Y-m-d - h:m'), |
||
53 | ]; |
||
54 | $newData = array_merge($newData, $form->getData()); |
||
55 | |||
56 | $data = null !== $existentData ? array_merge($existentData, [$newData]) : [$newData]; |
||
57 | |||
58 | file_put_contents($this->yamlFile, Yaml::dump($data)); |
||
59 | } |
||
60 | } |
||
61 |