public function fillCache (?SymfonyStyle $io)
    {
        $progressBar = null;

        if (null !== $io)
        {
            $io->section("Cache Warm up");
        }

        if ($this->isDebug)
        {
            if (null !== $io)
            {
                $io->comment("Skipping, as the assets are not dumped in debug mode.");
            }

            return;
        }

        if (null !== $io)
        {
            $io->text("Searching for all assets in the bundles/ directory...");
        }

        $assets = $this->finder->findAssets();

        if (null !== $io)
        {
            $io->text(sprintf(
                "Found <fg=yellow>%d asset%s</>.",
                count($assets),
                count($assets) !== 1 ? "s" : ""
            ));
        }

        if (0 === count($assets))
        {
            return;
        }

        if (null !== $io)
        {
            $io->newLine();
            $progressBar = $io->createProgressBar(count($assets));
        }

        $progressCallback = (null !== $progressBar)
            ? [$progressBar, "advance"]
            : null;

        $this->registry->add($assets, $progressCallback);

        if (null !== $io)
        {
            $progressBar->finish();
            $io->newLine(2);
        }
    }
public function fillCache (?SymfonyStyle $io)
    {
        $progressBar = null;

        if (null !== $io)
        {
            $io->section("Cache Warm up");
        }

        if ($this->isDebug)
        {
            if (null !== $io)
            {
                $io->comment("Skipping, as the assets are not dumped in debug mode.");
            }

            return;
        }

        if (null !== $io)
        {
            $io->text("Searching for all assets in the bundles/ directory...");
        }

        $assets = $this->finder->findAssets();

        if (null !== $io)
        {
            $io->text(sprintf(
                "Found <fg=yellow>%d asset%s</>.",
                count($assets),
                count($assets) !== 1 ? "s" : ""
            ));
        }

        if (0 === count($assets))
        {
            return;
        }

        if (null !== $io)
        {
            $io->newLine();
            $progressBar = $io->createProgressBar(count($assets));
        }

        $progressCallback = (null !== $progressBar)
            ? [$progressBar, "advance"]
            : null;

        $this->registry->add($assets, $progressCallback);

        if (null !== $io)
        {
            $progressBar->finish();
            $io->newLine(2);
        }
    }
public function fillCache ( ? SymfonyStyle $ io ) { $ progressBar = null ; if ( null !== $ io ) { $ io -> section ( "Cache Warm up" ) ; } if ( $ this -> isDebug ) { if ( null !== $ io ) { $ io -> comment ( "Skipping, as the assets are not dumped in debug mode." ) ; } return ; } if ( null !== $ io ) { $ io -> text ( "Searching for all assets in the bundles/ directory..." ) ; } $ assets = $ this -> finder -> findAssets ( ) ; if ( null !== $ io ) { $ io -> text ( sprintf ( "Found <fg=yellow>%d asset%s</>." , count ( $ assets ) , count ( $ assets ) !== 1 ? "s" : "" ) ) ; } if ( 0 === count ( $ assets ) ) { return ; } if ( null !== $ io ) { $ io -> newLine ( ) ; $ progressBar = $ io -> createProgressBar ( count ( $ assets ) ) ; } $ progressCallback = ( null !== $ progressBar ) ? [ $ progressBar , "advance" ] : null ; $ this -> registry -> add ( $ assets , $ progressCallback ) ; if ( null !== $ io ) { $ progressBar -> finish ( ) ; $ io -> newLine ( 2 ) ; } }
Warms up the cache

@param SymfonyStyle|null $io
@throws AssetsException
Warms up the cache