Exemple #1
0
 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;
 }
Exemple #2
0
 /**
  * @expectedException \PHPUnit_Framework_Error_Deprecated
  */
 public function testHasDeprecatedAddSubscriber()
 {
     $emitter = new Emitter();
     $emitter->addSubscriber('foo', new TestEventSubscriber());
 }