public static function prepareConfig($config, $logger) { $emitter = new Emitter(); if ($logger) { if ($logger instanceof \Psr\Log\LoggerInterface) { $emitter->attach(new LogSubscriber($logger, Formatter::DEBUG)); } else { throw new \Exception('Logger must implement PsrLogLoggerInterface'); } } $config['emitter'] = $emitter; return $config; }
/** * @expectedException \PHPUnit_Framework_Error_Deprecated */ public function testHasDeprecatedAddSubscriber() { $emitter = new Emitter(); $emitter->addSubscriber('foo', new TestEventSubscriber()); }