. * * @file * @ingroup extensions */ namespace Popups\EventLogging; use Config; use ExtensionRegistry; class EventLoggerFactory { /** * @var ExtensionRegistry */ private $registry; /** * @var \Config */ private $config; public function __construct( Config $config, ExtensionRegistry $registry ) { $this->registry = $registry; $this->config = $config; } /** * @return EventLogger */ public function get() { if ( $this->registry->isLoaded( 'EventLogging' ) ) { return new MWEventLogger( $this->config, $this->registry ); } return new NullLogger(); } }