appState = $appState; $this->dateTime = $dateTime; $this->productMetadata = $productMetadata; $this->moduleList = $moduleList; $this->encryptor = $encryptor; $this->themeList = $themeList; $this->util = $util; $this->assetConfig = $assetConfig; $this->getTrueCustomerKey = $getTrueCustomerKey; } /** * Get debug information. * * @return array */ public function execute() : array { return [ 'core' => $this->getCoreMagentoInfo(), 'phpVersion' => $this->util->getTrimmedPhpVersion(), 'additional' => [ 'time' => $this->dateTime->date(), 'cssMinification' => $this->assetConfig->isMergeCssFiles(), 'jsMinification' => $this->assetConfig->isMergeJsFiles(), 'jsBundling' => $this->assetConfig->isBundlingJsFiles(), 'minifyHtml' => $this->assetConfig->isMinifyHtml(), 'potential_conflicts' => $this->getPotentialConflicts(), 'signature' => $this->encryptor->hash($this->getTrueCustomerKey->execute('Base')), ], ]; } /** * Get magento details. * * @return array */ private function getCoreMagentoInfo() : array { return [ 'mode' => $this->appState->getMode(), 'version' => $this->productMetadata->getVersion(), 'name' => $this->productMetadata->getName(), 'edition' => $this->productMetadata->getEdition(), ]; } /** * Get third party extensions and themes. * * @return array */ private function getPotentialConflicts() : array { return [ 'modules' => $this->getThirdPartyExtensions(), 'themes' => $this->getThirdPartyThemes(), ]; } /** * Get list of third party extensions. * * @return array */ private function getThirdPartyExtensions() : array { $notConflictingVendors = $this->notConflictingVendors; $notConflictingExtensions = $this->notConflictingExtensions; return array_values( array_filter( $this->moduleList->getNames(), static function ($moduleFullName) use ($notConflictingVendors, $notConflictingExtensions) { $vendor = explode('_', $moduleFullName)[0]; if (in_array($vendor, $notConflictingVendors, true)) { return false; } if (in_array($moduleFullName, $notConflictingExtensions, true)) { return false; } return true; } ) ); } /** * Get list of third party themes. * * @return array */ private function getThirdPartyThemes() : array { return array_filter( $this->themeList->getColumnValues('code'), static function ($theme) { return strpos($theme, 'Magento/') !== 0; } ); } }