getMessage()->setEncoding($this->encoding); } /** * Attach one or more listeners * * Implementors may add an optional $priority argument; the EventManager * implementation will pass this to the aggregate. * * @param EventManagerInterface $events * * @return void */ public function attach(EventManagerInterface $events) { $this->listeners[] = $events->attach(ComposerEvent::EVENT_COMPOSE_PRE, array($this, 'setMessageEncoding')); } /** * @param string $encoding * @return self */ public function setEncoding($encoding) { $this->encoding = $encoding; return $this; } /** * @return string */ public function getEncoding() { return $this->encoding; } }