Conditions | 2 |
Paths | 2 |
Total Lines | 15 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
31 | private function writeToString($object): string |
||
32 | { |
||
33 | $writer = new XMLWriter(); |
||
34 | $writer->openMemory(); |
||
35 | $writer->startDocument('1.0', 'UTF-8'); |
||
36 | $writer->setIndent(true); |
||
37 | $writer->startElement('yml_catalog'); |
||
38 | $writer->writeAttribute('date', (new DateTimeImmutable('now'))->format('Y-m-d H:i')); |
||
39 | |||
40 | if (null !== $object) { |
||
41 | $object->write($writer); |
||
42 | } |
||
43 | |||
44 | $writer->endElement(); |
||
45 | return $writer->flush(); |
||
46 | } |
||
48 |