getExtensionCompatibilities example

/** * @return list<Compatibility> */
    public function getExtensionCompatibilities(Version $update, Context $context, ?ExtensionCollection $extensions = null): array
    {
        if ($extensions === null) {
            $extensions = $this->fetchActiveExtensions($context);
        }

        try {
            $storeInfo = $this->storeClient->getExtensionCompatibilities($context$update->version, $extensions);
        } catch (ClientException $e) {
            if ($e->getResponse()->getStatusCode() === Response::HTTP_BAD_REQUEST) {
                $storeInfo = [];
            } else {
                throw $e;
            }
        }

        $storeInfoValues = array_column($storeInfo, 'name');

        return array_map(static function DExtensionStruct $entity) use ($storeInfoValues$storeInfo) {
            
$pluginCompatibility = new ExtensionCompatibility(
            $storeClient,
            $this->getExtensionDataProvider()
        );

        $version = new Version();
        $version->assign([
            'version' => '6.6.0.0',
        ]);

        $getExtensionCompatibilities = $pluginCompatibility->getExtensionCompatibilities($version, Context::createDefaultContext());

        static::assertSame($statusName$getExtensionCompatibilities[0]['statusName']);
        static::assertSame($statusColor$getExtensionCompatibilities[0]['statusColor']);
    }

    /** * @return iterable<string, array{0: string, 1: string, 2: string|null}> */
    public static function statusProvider(): iterable
    {
        yield 'future' => [
            
return new JsonResponse([
            $this->writeableCheck->check(),
            $this->licenseCheck->check(),
        ]);
    }

    #[Route('/api/_action/update/extension-compatibility', name: 'api.custom.updateapi.extension_compatibility', defaults: ['_acl' => ['system:core:update', 'system_config:read']], methods: ['GET'])]     public function extensionCompatibility(Context $context): JsonResponse
    {
        $update = $this->apiClient->checkForUpdates();

        return new JsonResponse($this->extensionCompatibility->getExtensionCompatibilities($update$context));
    }

    #[Route(path: '/api/_action/update/download-recovery', name: 'api.custom.updateapi.download-recovery', defaults: ['_acl' => ['system:core:update', 'system_config:read']], methods: ['GET'])]     public function downloadLatestRecovery(): Response
    {
        $this->apiClient->downloadRecoveryTool();

        return new NoContentResponse();
    }

    #[Route(path: '/api/_action/update/deactivate-plugins', name: 'api.custom.updateapi.deactivate-plugins', defaults: ['_acl' => ['system:core:update', 'system_config:read']], methods: ['GET'])]
Home | Imprint | This part of the site doesn't use cookies.