config = $config; $this->backendAuthSession = $backendAuthSession; $this->deploymentsFactory = $deploymentsFactory; } /** * Report system cache is flushed to New Relic * * @param Observer $observer * @return void * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function execute(Observer $observer) { if ($this->config->isNewRelicEnabled()) { $user = $this->backendAuthSession->getUser(); if ($user->getId()) { $this->deploymentsFactory->create()->setDeployment( 'Cache Flush', $user->getUserName() . ' flushed the cache.', $user->getUserName() ); } } } }