/** * Verifies that we can set and retrieve the contents. */ public function testFile() { self::assertEquals($this->contents, $this->event->getContents()); self::assertSame($this->event, $this->event->setContents('<?php echo "Goodbye, world!";')); self::assertEquals('<?php echo "Goodbye, world!";', $this->event->getContents()); }
/** * Processes a file that is about to be added from a string. * * @param PreAddFromStringEvent $event The event arguments. */ public function onAddFromString(PreAddFromStringEvent $event) { if ($this->processor->supports($event->getLocal())) { $event->setContents($this->processor->process($event->getLocal(), $event->getContents())); } }