<commit_before><?php

namespace Nails\Cli\Command;

use Nails\Cli\Helper\Colors;
use Nails\Cli\Helper\Updates;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Helper\QuestionHelper;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Question\ChoiceQuestion;
use Symfony\Component\Console\Question\ConfirmationQuestion;
use Symfony\Component\Console\Question\Question;

abstract class Base extends Command
{
    /**
     * The success exit code
     *
     * @var int
     */
    const EXIT_CODE_SUCCESS = 0;

    // --------------------------------------------------------------------------

    /**
     * The console's input interface
     *
     * @var InputInterface
     */
    protected $oInput;

    /**
     * The console's output interface
     *
     * @var OutputInterface
     */
    protected $oOutput;

    /**
     * The question helper
     *
     * @var QuestionHelper
     */
    protected $oQuestion;

    // --------------------------------------------------------------------------

    /**
     * Execute the command
     *
     * @param InputInterface  $oInput
     * @param OutputInterface $oOutput
     *
     * @return int
     */
    protected function execute(InputInterface $oInput, OutputInterface $oOutput): int
    {
        $this->oInput    = $oInput;
        $this->oOutput   = $oOutput;
        $this->oQuestion = $this->getHelper('question');

        if (Updates::check()) {
            $this->warning([
                'An update is available: ' . Updates::getLatestVersion() . ' (you have version ' . Updates::getCurrentVersion() . ')',
                'To update run: brew update && brew upgrade nails',
            ]);
        }

        Colors::setStyles($this->oOutput);

        return $this->go();
    }

    // --------------------------------------------------------------------------

    /**
     * The command's body
     *
     * @return mixed
     */
    abstract protected function go();

    // --------------------------------------------------------------------------

    /**
     * Display a underlined title banner
     *<commit_msg>Fixes issue with <warning> blocks not rendering as colours<commit_after><?php

namespace Nails\Cli\Command;

use Nails\Cli\Helper\Colors;
use Nails\Cli\Helper\Updates;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Helper\QuestionHelper;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Question\ChoiceQuestion;
use Symfony\Component\Console\Question\ConfirmationQuestion;
use Symfony\Component\Console\Question\Question;

abstract class Base extends Command
{
    /**
     * The success exit code
     *
     * @var int
     */
    const EXIT_CODE_SUCCESS = 0;

    // --------------------------------------------------------------------------

    /**
     * The console's input interface
     *
     * @var InputInterface
     */
    protected $oInput;

    /**
     * The console's output interface
     *
     * @var OutputInterface
     */
    protected $oOutput;

    /**
     * The question helper
     *
     * @var QuestionHelper
     */
    protected $oQuestion;

    // --------------------------------------------------------------------------

    /**
     * Execute the command
     *
     * @param InputInterface  $oInput
     * @param OutputInterface $oOutput
     *
     * @return int
     */
    protected function execute(InputInterface $oInput, OutputInterface $oOutput): int
    {
        $this->oInput    = $oInput;
        $this->oOutput   = $oOutput;
        $this->oQuestion = $this->getHelper('question');

        Colors::setStyles($this->oOutput);

        if (Updates::check()) {
            $this->warning([
                'An update is available: ' . Updates::getLatestVersion() . ' (you have version ' . Updates::getCurrentVersion() . ')',
                'To update run: brew update && brew upgrade nails',
            ]);
        }

        return $this->go();
    }

    // --------------------------------------------------------------------------

    /**
     * The command's body
     *
     * @return mixed
     */
    abstract protected function go();

    // --------------------------------------------------------------------------

    /**
     * Display a underlined title banner
     *
{'fraction_non_alphanumeric': 0.23648193852367064, 'fraction_numerical': 0.0004487323311644604, 'mean_word_length': 1.4643449419568824, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 18, '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': '7208356', 'n_tokens_mistral': 1138, 'n_tokens_neox': 1099, 'n_words': 246}