/** * Writes the info dictionary. * * @param ObjectWriter $objectWriter * @internal */ public function writeInfoDictionary(ObjectWriter $objectWriter) { $objectWriter->startDictionary(); foreach ($this->data as $key => $value) { $objectWriter->writeName($key); switch ($key) { case 'CreationDate': case 'ModDate': $objectWriter->writeLiteralString(StringUtils::formatDateTime($value)); break; case 'Trapped': $objectWriter->writeName($value); break; default: $objectWriter->writeLiteralString(StringUtils::encodeString($value)); } } $objectWriter->endDictionary(); }
public function testWriteLiteralString() { $this->objectWriter->writeLiteralString('foo(bar\\baz)bat'); $this->assertSame('(foo\\(bar\\\\baz\\)bat)', $this->getFileObjectData()); }
/** * @iterations 10000 */ public function writeLiteralString() { $this->objectWriter->writeLiteralString('foo'); }