getStyleFiles example

'views' => ['Resources/views'],
                'technicalName' => \str_replace('_', '-', $bundle->getContainerPrefix()),
                'administration' => [
                    'path' => 'Resources/app/administration/src',
                    'entryFilePath' => $this->getEntryFile($bundle->getPath(), 'Resources/app/administration/src'),
                    'webpack' => $this->getWebpackConfig($bundle->getPath(), 'Resources/app/administration'),
                ],
                'storefront' => [
                    'path' => 'Resources/app/storefront/src',
                    'entryFilePath' => $this->getEntryFile($bundle->getPath(), 'Resources/app/storefront/src'),
                    'webpack' => $this->getWebpackConfig($bundle->getPath(), 'Resources/app/storefront'),
                    'styleFiles' => $this->getStyleFiles($bundle->getName()),
                ],
            ];
        }

        return $bundles;
    }

    private function generateAppConfigs(): array
    {
        $configs = [];
        foreach ($this->activeAppsLoader->getActiveApps() as $app) {
            

        $id = Uuid::randomHex();

        $fs = new Filesystem(new InMemoryFilesystemAdapter());
        $fs->write('theme-config/' . $id . '.json', (string) file_get_contents(__DIR__ . '/../fixtures/ConfigLoader/theme-config.json'));

        $s = new StaticFileConfigLoader($fs);
        $config = $s->load($id, Context::createDefaultContext());

        static::assertInstanceOf(StorefrontPluginConfiguration::class$config);
        static::assertInstanceOf(FileCollection::class$config->getScriptFiles());
        static::assertInstanceOf(FileCollection::class$config->getStyleFiles());

        $themeConfig = $config->getThemeConfig();
        static::assertIsArray($themeConfig);
        static::assertSame(
            [
                'blocks',
                'fields',
                'sw-color-brand-primary',
                'sw-color-brand-secondary',
                'sw-border-color',
                'sw-background-color',
                
$storefrontBundle = new MockStorefront();

        $factory = new StorefrontPluginConfigurationFactory($this->getContainer()->getParameter('kernel.project_dir'));
        $config = $factory->createFromBundle($themePluginBundle);
        $storefront = $factory->createFromBundle($storefrontBundle);

        $configCollection = new StorefrontPluginConfigurationCollection();
        $configCollection->add($config);
        $configCollection->add($storefront);

        $projectDir = $this->getContainer()->getParameter('kernel.project_dir');
        $firstFile = $config->getStyleFiles()->first();
        $currentPath = $firstFile ? $firstFile->getFilepath() : '';

        (new ThemeFileResolver(new ThemeFileImporter($projectDir)))->resolveFiles(
            $config,
            $configCollection,
            false
        );

        // Path is still relative         static::assertSame(
            $currentPath,
            
'SELECT theme.technical_name as technicalName, LOWER(HEX(theme.id)) as parentThemeId FROM theme'
        );

        return $result;
    }

    private function isDependentTheme(
        StorefrontPluginConfiguration $parentConfig,
        StorefrontPluginConfiguration $currentThemeConfig
    ): bool {
        return $currentThemeConfig->getTechnicalName() !== $parentConfig->getTechnicalName()
            && \in_array('@' . $parentConfig->getTechnicalName()$currentThemeConfig->getStyleFiles()->getFilepaths(), true)
        ;
    }

    /** * @param array<int|string, mixed> $field */
    private function hasNewMedia(array $field): bool
    {
        return \array_key_exists('type', $field) && $field['type'] === 'media'
            && \array_key_exists('value', $field) && \is_string($field['value']);
    }

    
static::assertTrue($config->getIsTheme());
        static::assertEquals(
            $basePath . '/Resources/app/storefront/src/main.js',
            $config->getStorefrontEntryFilepath()
        );
        $this->assertFileCollection([
            $basePath . '/Resources/app/storefront/src/scss/overrides.scss' => [],
            '@Storefront' => [],
            $basePath . '/Resources/app/storefront/src/scss/base.scss' => [
                'vendor' => $basePath . '/Resources/app/storefront/vendor',
            ],
        ]$config->getStyleFiles());
        $this->assertFileCollection([
            '@Storefront' => [],
            $basePath . '/Resources/app/storefront/dist/js/main.js' => [],
        ]$config->getScriptFiles());
        static::assertEquals([
            '@Storefront',
            '@Plugins',
            '@SwagTheme',
        ]$config->getViewInheritance());
        static::assertEquals([
            $basePath . '/Resources/app/storefront/dist/assets',
        ],
 {
                        $fileCollection->add(new File($configuration->getStorefrontEntryFilepath()));
                    }

                    return $fileCollection;
                }
            ),
            self::STYLE_FILES => $this->resolve(
                $themeConfig,
                $configurationCollection,
                $onlySourceFiles,
                fn (StorefrontPluginConfiguration $configuration) => $configuration->getStyleFiles()
            ),
        ];
    }

    /** * @param callable(StorefrontPluginConfiguration, bool): FileCollection $configFileResolver * @param array<int, string> $included */
    private function resolve(
        StorefrontPluginConfiguration $themeConfig,
        StorefrontPluginConfigurationCollection $configurationCollection,
        
/** * @param array<string, string> $iconSets */
    public function setIconSets(array $iconSets): void
    {
        $this->iconSets = $iconSets;
    }

    public function hasFilesToCompile(): bool
    {
        return \count($this->getStyleFiles()) !== 0 || \count($this->getScriptFiles()) !== 0;
    }

    /** * @param array<int, string> $configInheritance */
    public function setConfigInheritance(array $configInheritance): void
    {
        $this->configInheritance = $configInheritance;
    }

    /** * @return array<int, string> */
Home | Imprint | This part of the site doesn't use cookies.