<commit_before><?php

namespace CommerceGuys\Platform\Cli\Command;

use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Question\ConfirmationQuestion;

class PlatformLogoutCommand extends PlatformCommand
{

    protected $removeConfigFile;

    protected function configure()
    {
        $this
            ->setName('logout')
            ->setDescription('Log out of Platform');
    }

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $helper = $this->getHelper('question');
        $question = new ConfirmationQuestion('This command will remove your current Platform configuration. You will have to re-enter your Platform credentials to use the CLI tool. Are you sure you wish to continue? ', false);

        if (!$helper->ask($input, $output, $question)) {
            return;
        }
        else {
            try {
                $this->removeConfigFile = TRUE;
                $application = $this->getApplication();
                $configPath = $application->getHomeDirectory() . '/.platform';
                unlink($configPath);
                $output->writeln("<comment>Your Platform configuration file has been removed and you have been logged out of the Platform CLI.</comment>");
            }
            catch (\Exception $e) {

            }<commit_msg>Fixes #23 and fixes #49<commit_after><?php

namespace CommerceGuys\Platform\Cli\Command;

use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Question\ConfirmationQuestion;

class PlatformLogoutCommand extends PlatformCommand
{

    protected $removeConfigFile;

    protected function configure()
    {
        $this
            ->setName('logout')
            ->setDescription('Log out of Platform');
    }

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $helper = $this->getHelper('question');
        $question = new ConfirmationQuestion('This command will remove your current Platform configuration. You will have to re-enter your Platform credentials to use the CLI tool. Are you sure you wish to continue? ', false);

        if (!$helper->ask($input, $output, $question)) {
            return;
        }
        else {
            try {
                $this->removeConfigFile = TRUE;
                $application = $this->getApplication();
                $configPath = $application->getHomeDirectory() . '/.platform';
                unlink($configPath);
                $output->writeln("<comment>Your Platform configuration file has been removed and you have been logged out of the Platform CLI.</comment>");
            }
            catch (\Exception $e) {
                // @todo: Real exception handling here.
            }
{'fraction_non_alphanumeric': 0.10121739130434783, 'fraction_numerical': 0.001391304347826087, 'mean_word_length': 2.5462392108508016, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 23, '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': '394806', 'n_tokens_mistral': 703, 'n_tokens_neox': 676, 'n_words': 205}