<commit_before><?php

/**
 * This file is part of frontend-block
 *
 * (c) <NAME> <<EMAIL>>
 *
 * This source file is subject to the license that is bundled
 * with this source code in the file LICENSE
 */

namespace Bldr\Block\Frontend\Call\Minify;

use Bldr\Call\AbstractCall;
use Bldr\Call\Traits\FinderAwareTrait;
use JShrink\Minifier;
use Symfony\Component\Finder\SplFileInfo;
use Symfony\Component\Filesystem\Filesystem;

/**
 * @author <NAME> <<EMAIL>>
 */
class JsCall extends AbstractCall
{
    use FinderAwareTrait;

    public function configure()
    {
        $this->setName('minify:js')
            ->setDescription('Minified the src files into the dest')
            ->addOption('src', true, 'Files to Minify')
            ->addOption('dest', true, 'Destination to save minified js');
    }

    public function run()
    {
        $destination = $this->getOption('dest');

        /** @var SplFileInfo[] $files */
        $files = $this->getFiles($this->getOption('src'));

        $code = '';
        foreach ($files as $file) {
            $code .= $file->getContents();
        }

        if ($this->getOutput()->isVerbose()) {
            $this->getOutput()->writeln("Writing to ".$destination);
        }

        $fs = new Filesystem();
        $fs->mkdir(dirnam($destination));
        $fs->dumpFile($destination, Minifier::minify($code));
    }
}<commit_msg>Changing JS Minifier<commit_after><?php

/**
 * This file is part of frontend-block
 *
 * (c) <NAME> <<EMAIL>>
 *
 * This source file is subject to the license that is bundled
 * with this source code in the file LICENSE
 */

namespace Bldr\Block\Frontend\Call\Minify;

use Bldr\Call\AbstractCall;
use Bldr\Call\Traits\FinderAwareTrait;
use JShrink\Minifier;
use Symfony\Component\Finder\SplFileInfo;
use Symfony\Component\Filesystem\Filesystem;

/**
 * @author <NAME> <<EMAIL>>
 */
class JsCall extends AbstractCall
{
    use FinderAwareTrait;

    public function configure()
    {
        $this->setName('minify:js')
            ->setDescription('Minified the src files into the dest')
            ->addOption('src', true, 'Files to Minify')
            ->addOption('dest', true, 'Destination to save minified js');
    }

    public function run()
    {
        $destination = $this->getOption('dest');

        /** @var SplFileInfo[] $files */
        $files = $this->getFiles($this->getOption('src'));

        $code = '';
        foreach ($files as $file) {
            $code .= $file->getContents();
        }

        if ($this->getOutput()->isVerbose()) {
            $this->getOutput()->writeln("Writing to ".$destination);
        }

        $fs = new Filesystem();
        $fs->mkdir(dirname($destination));
        $fs->dumpFile($destination, Minifier::minify($code));
    }
}
{'fraction_non_alphanumeric': 0.1544011544011544, 'fraction_numerical': 0.0, 'mean_word_length': 2.7221476510067113, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 43, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5801283', 'n_tokens_mistral': 860, 'n_tokens_neox': 844, 'n_words': 204}