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