getPluginStateDescription example

$updatesAvailable = $service->getPlugins($request);

        try {
            $results = [];
            foreach ($installedPlugins as $plugin) {
                $technicalName = $plugin['name'];
                $key = strtolower($plugin['name']);
                $name = $plugin['label'];

                $inStore = \array_key_exists($key$storePlugins);
                $targetVersionUpdateAvailable = \array_key_exists($key$updatesAvailable);
                $description = $this->getPluginStateDescription($inStore$targetVersionUpdateAvailable);

                $results[] = [
                    'inStore' => $inStore,
                    'name' => $name,
                    'message' => $description,
                    'updatable' => $inStore && version_compare($plugin['version']$storePlugins[$key]->getVersion(), '<'),
                    'updatableAfterUpgrade' => $inStore && $targetVersionUpdateAvailable && $storePlugins[$key]->getVersion() !== $updatesAvailable[$key]->getVersion(),
                    'id' => sprintf('plugin_incompatible-%s', $name),
                    'technicalName' => $technicalName,
                    'errorLevel' => $targetVersionUpdateAvailable ? Validation::REQUIREMENT_VALID : Validation::REQUIREMENT_WARNING,
                    'success' => true,
                ];
Home | Imprint | This part of the site doesn't use cookies.