<commit_before><?php

namespace CL\SlackCli\Command;

use Herrera\Phar\Update\Manager;
use Herrera\Phar\Update\Manifest;
use Herrera\Version\Parser;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

class SelfUpdateCommand extends AbstractCommand
{
    const MANIFEST_FILE = 'http://cleentfaar.github.io/slack-cli/manifest.json';

    /**
     * {@inheritdoc}
     */
    protected function configure()
    {
        parent::configure();

        $this->setName('self:update');
        $this->setDescription('Updates slack.phar to the latest version');
    }

    /**
     * {@inheritdoc}
     */
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $currentVersion  = $this->getApplication()->getVersion();
        $manager         = new Manager(Manifest::loadFile(self::MANIFEST_FILE));
        $lockMajor       = false;
        $allowPreRelease = false;

        if (substr($currentVersion, 0, 1) == 0) {
            $allowPreRelease = true;
        }

        if ($manager->update($currentVersion, $lockMajor, $allowPreRelease)) {
            $newVersion = $this->getNewVersion($currentVersion, $manager, $lockMajor, $allowPreRelease);

            $this->output->writeln(sprintf(
                '<info>Updated Slack CLI from <fg=yellow>%s</fg=yellow> to <fg=yellow>%s</fg=yellow></info>',
                $currentVersion,
                $newVersion
            ));
        } else {
            $this->output->writeln(sprintf(<commit_msg>added alias for self:update (self.update) to stay compatible with 0.14 for a while<commit_after><?php

namespace CL\SlackCli\Command;

use Herrera\Phar\Update\Manager;
use Herrera\Phar\Update\Manifest;
use Herrera\Version\Parser;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

class SelfUpdateCommand extends AbstractCommand
{
    const MANIFEST_FILE = 'http://cleentfaar.github.io/slack-cli/manifest.json';

    /**
     * {@inheritdoc}
     */
    protected function configure()
    {
        parent::configure();

        $this->setName('self:update');
        $this->setDescription('Updates slack.phar to the latest version');
        $this->setAliases(['self.update']);
    }

    /**
     * {@inheritdoc}
     */
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $currentVersion  = $this->getApplication()->getVersion();
        $manager         = new Manager(Manifest::loadFile(self::MANIFEST_FILE));
        $lockMajor       = false;
        $allowPreRelease = false;

        if (substr($currentVersion, 0, 1) == 0) {
            $allowPreRelease = true;
        }

        if ($manager->update($currentVersion, $lockMajor, $allowPreRelease)) {
            $newVersion = $this->getNewVersion($currentVersion, $manager, $lockMajor, $allowPreRelease);

            $this->output->writeln(sprintf(
                '<info>Updated Slack CLI from <fg=yellow>%s</fg=yellow> to <fg=yellow>%s</fg=yellow></info>',
                $currentVersion,
                $newVersion
            ));
        } else {
            $this->output->writeln(sprintf(
{'fraction_non_alphanumeric': 0.13708920187793427, 'fraction_numerical': 0.0028169014084507044, 'mean_word_length': 2.7336448598130842, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 36, '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': '4546163', 'n_tokens_mistral': 942, 'n_tokens_neox': 908, 'n_words': 164}