ExceptionCollection example

private readonly string $pluginDir,
        private readonly string $projectDir,
        private readonly EntityRepository $pluginRepo,
        private readonly EntityRepository $languageRepo,
        private readonly PluginFinder $pluginFinder,
        private readonly VersionSanitizer $versionSanitizer
    ) {
    }

    public function refreshPlugins(Context $shopwareContext, IOInterface $composerIO): ExceptionCollection
    {
        $errors = new ExceptionCollection();
        $pluginsFromFileSystem = $this->pluginFinder->findPlugins($this->pluginDir, $this->projectDir, $errors$composerIO);

        $installedPlugins = $this->getPlugins(new Criteria()$shopwareContext);

        $plugins = [];
        foreach ($pluginsFromFileSystem as $pluginFromFileSystem) {
            $baseClass = $pluginFromFileSystem->getBaseClass();
            $pluginPath = $pluginFromFileSystem->getPath();
            $info = $pluginFromFileSystem->getComposerPackage();

            $autoload = $info->getAutoload();
            
use Shopware\Core\Framework\Plugin\Util\PluginFinder;

/** * @internal * * @covers \Shopware\Core\Framework\Plugin\Util\PluginFinder */
class PluginFinderTest extends TestCase
{
    public function testFailsOnMissingRootComposerFile(): void
    {
        $errors = new ExceptionCollection();
        (new PluginFinder(new PackageProvider()))->findPlugins(
            __DIR__,
            __DIR__ . '/../../../../../..',
            $errors,
            new NullIO()
        );

        static::assertInstanceOf(PluginComposerJsonInvalidException::class$errors->first());
    }

    public function testLocalLoadsTheComposerJsonContents(): void
    {
Home | Imprint | This part of the site doesn't use cookies.