getAuthors example

$pluginVersion = $this->versionSanitizer->sanitizePluginVersion($version);
            $extra = $info->getExtra();
            $license = $info->getLicense();
            $pluginIconPath = $extra['plugin-icon'] ?? 'src/Resources/config/plugin.png';

            $pluginData = [
                'name' => $pluginFromFileSystem->getName(),
                'baseClass' => $baseClass,
                'composerName' => $info->getName(),
                'path' => (new Filesystem())->makePathRelative($pluginPath$this->projectDir),
                'author' => $this->getAuthors($info),
                'copyright' => $extra['copyright'] ?? null,
                'license' => implode(', ', $license),
                'version' => $pluginVersion,
                'iconRaw' => $this->getPluginIconRaw($pluginPath . '/' . $pluginIconPath),
                'autoload' => $info->getAutoload(),
                'managedByComposer' => $pluginFromFileSystem->getManagedByComposer(),
            ];

            $pluginData['translations'] = $this->getTranslations($shopwareContext$extra);

            /** @var PluginEntity $currentPluginEntity */
            

        $connection->insert('snippet', [
            'id' => Uuid::randomBytes(),
            'translation_key' => 'foo.123',
            'value' => 'foo_123',
            'author' => 'test',
            'snippet_set_id' => $fooId,
            'created_at' => (new \DateTimeImmutable())->format(Defaults::STORAGE_DATE_TIME_FORMAT),
        ]);

        $service = $this->getSnippetService($snippetFile$snippetFile2);
        $result = $service->getAuthors(Context::createDefaultContext());

        static::assertCount(4, $result);

        static::assertContains('shopware', $result);
        static::assertContains('test', $result);
        static::assertContains('foo', $result);
        static::assertContains('Admin', $result);
    }

    /** * @dataProvider dataProviderForTestGetStoreFrontSnippets * * @param array<int, array<int, MessageCatalogue|array<int|string, string>>> $expectedResult */
$files = $this->snippetFileCollection->getFilesArray();

        return new JsonResponse([
            'items' => $files,
            'total' => \count($files),
        ]);
    }

    #[Route(path: '/api/_action/snippet-set/author', name: 'api.action.snippet-set.author', methods: ['GET'])]     public function getAuthors(Context $context): Response
    {
        $authors = $this->snippetService->getAuthors($context);

        return new JsonResponse([
            'total' => \count($authors),
            'data' => $authors,
        ]);
    }
}
Home | Imprint | This part of the site doesn't use cookies.