<commit_before><?php

namespace Sokil\DeployBundle\Task;

use Sokil\DeployBundle\Exception\TaskExecuteException;
use Sokil\DeployBundle\TaskManager\ProcessRunner;
use Symfony\Component\Console\Output\OutputInterface;

class ComposerTask extends AbstractTask implements
    ProcessRunnerAwareTaskInterface
{
    /**
     * @var ProcessRunner
     */
    private $processRunner;

    /**
     * @param ProcessRunner $runner
     */
    public function setProcessRunner(ProcessRunner $runner)
    {
        $this->processRunner = $runner;
    }

    public function getDescription()
    {
        return 'Update composer dependencies';
    }

    protected function prepareOptions(array $options)
    {
        // disable composer scripts by default
        if (!isset($options['scripts'])) {
            $options['scripts'] = true;
        } else {
            $options['scripts'] = (bool)$options['scripts'];
        }

        return $options;
    }

    public function run(
        array $commandOptions,
        $environment,
        $verbosity,
        OutputInterface $output
    ) {
        $output->writeln('<' . $this->h2Style . '>Updating composer dependencies</>');

        $command = 'composer.phar update --optimize-autoloader --no-interaction';

        // env
        if ($environment !== 'dev') {
            $command .= ' --no-dev';
        }

        // scripts
        if (false === $this->getOption('scripts')) {
            $command .= ' --no-scripts';
        }

        // verbosity
        switch ($verbosity) {
            case OutputInterface::VERBOSITY_VERBOSE:
                $command .= ' -v';
                break;
            case OutputInterface::VERBOSITY_VERY_VERBOSE:
                $command .= ' -vv';<commit_msg>install instead of updatye<commit_after><?php

namespace Sokil\DeployBundle\Task;

use Sokil\DeployBundle\Exception\TaskExecuteException;
use Sokil\DeployBundle\TaskManager\ProcessRunner;
use Symfony\Component\Console\Output\OutputInterface;

class ComposerTask extends AbstractTask implements
    ProcessRunnerAwareTaskInterface
{
    /**
     * @var ProcessRunner
     */
    private $processRunner;

    /**
     * @param ProcessRunner $runner
     */
    public function setProcessRunner(ProcessRunner $runner)
    {
        $this->processRunner = $runner;
    }

    public function getDescription()
    {
        return 'Update composer dependencies';
    }

    protected function prepareOptions(array $options)
    {
        // disable composer scripts by default
        if (!isset($options['scripts'])) {
            $options['scripts'] = true;
        } else {
            $options['scripts'] = (bool)$options['scripts'];
        }

        return $options;
    }

    public function run(
        array $commandOptions,
        $environment,
        $verbosity,
        OutputInterface $output
    ) {
        $output->writeln('<' . $this->h2Style . '>Updating composer dependencies</>');

        $command = 'composer.phar install --optimize-autoloader --no-interaction';

        // env
        if ($environment !== 'dev') {
            $command .= ' --no-dev';
        }

        // scripts
        if (false === $this->getOption('scripts')) {
            $command .= ' --no-scripts';
        }

        // verbosity
        switch ($verbosity) {
            case OutputInterface::VERBOSITY_VERBOSE:
                $command .= ' -v';
                break;
            case OutputInterface::VERBOSITY_VERY_VERBOSE:
                $command .= ' -vv';
{'fraction_non_alphanumeric': 0.12279704377487209, 'fraction_numerical': 0.0005685048322910744, 'mean_word_length': 2.0814360770577935, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 15, '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': '2068609', 'n_tokens_mistral': 958, 'n_tokens_neox': 937, 'n_words': 194}