<commit_before><?php
/**
 * Created by PhpStorm.
 * User: daniel
 * Date: 05.10.14
 * Time: 16:58
 */

namespace Cundd\PersistentObjectStore\Console;


use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

/**
 * Console command to run an interactive session
 *
 * @package Cundd\PersistentObjectStore\Console
 */
class ConsoleCommand extends Command
{
    const MESSAGE_WELCOME = <<<WELCOME


                        /\
                       /  \
                      /____\
      __________      |    |
    /__________/\     |[]_ |
   /__________/()\    |   -|_
  /__________/    \   |    |
  | [] [] [] | [] |  _|    |
  |   ___    |    |   |–_  |
  |   |_| [] | [] |   |  –_|

         STAIRTOWER
   PERSISTENT OBJECT STORE
    a home for your data

WELCOME;

    /**
     * Document Access Coordinator
     *
     * @var \Cundd\PersistentObjectStore\DataAccess\CoordinatorInterface
     * @Inject
     */
    protected $coordinator;

    /**
     * Commands to terminate the console
     *
     * @var array
     */
    protected $exitCommands = array('quit', 'exit', '\\q');

    /**
     * Configure the command
     */
    protected function configure()
    {
        $this
            ->setName('console')
            ->setDescription('Run an interactive session')
//			->addArgument(
//				'name',
//				InputArgument::OPTIONAL,
//				'Who do you want to greet?'
//			)
//			->addOption(
//				'yell',
//				null,
//				InputOption::VALUE_NONE,
//				'If set, the task will yell in uppercase letters'
//			)
        ;
    }

    /**
     * Execute the command
     *
     * @param InputInterface  $input
     * @param OutputInterface $output
     * @return int|null|void
     */
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $output->write(self::MESSAGE_WELCOME);
        $output->write('> ');
        while ($line = fgets(STDIN, 1024 * 5)) {
            $line = trim($line);

            if (in_array($line, $this->exitCommands)) {
                $output->writeln('Goodbye');
                break;
            }

            $commandParts = explode(' ', $line);
            $subCommand   = array_shift($commandParts);
            $this->executeSubCommand($subCommand, $commandParts, $output);
<commit_msg>Use the welcome message from the constants<commit_after><?php
/**
 * Created by PhpStorm.
 * User: daniel
 * Date: 05.10.14
 * Time: 16:58
 */

namespace Cundd\PersistentObjectStore\Console;


use Cundd\PersistentObjectStore\Constants;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

/**
 * Console command to run an interactive session
 *
 * @package Cundd\PersistentObjectStore\Console
 */
class ConsoleCommand extends Command
{
    /**
     * Document Access Coordinator
     *
     * @var \Cundd\PersistentObjectStore\DataAccess\CoordinatorInterface
     * @Inject
     */
    protected $coordinator;

    /**
     * Commands to terminate the console
     *
     * @var array
     */
    protected $exitCommands = array('quit', 'exit', '\\q');

    /**
     * Configure the command
     */
    protected function configure()
    {
        $this
            ->setName('console')
            ->setDescription('Run an interactive session')
//			->addArgument(
//				'name',
//				InputArgument::OPTIONAL,
//				'Who do you want to greet?'
//			)
//			->addOption(
//				'yell',
//				null,
//				InputOption::VALUE_NONE,
//				'If set, the task will yell in uppercase letters'
//			)
        ;
    }

    /**
     * Execute the command
     *
     * @param InputInterface  $input
     * @param OutputInterface $output
     * @return int|null|void
     */
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $output->write(Constants::MESSAGE_CLI_WELCOME);
        $output->write('> ');
        while ($line = fgets(STDIN, 1024 * 5)) {
            $line = trim($line);

            if (in_array($line, $this->exitCommands)) {
                $output->writeln('Goodbye');
                break;
            }

            $commandParts = explode(' ', $line);
            $subCommand   = array_shift($commandParts);
            $this->executeSubCommand($subCommand, $commandParts, $output);

{'fraction_non_alphanumeric': 0.13607451158564288, 'fraction_numerical': 0.0068150840527033164, 'mean_word_length': 2.0533980582524274, 'pattern_counts': {'":': 0, '<': 8, '<?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': '7129872', 'n_tokens_mistral': 1415, 'n_tokens_neox': 1322, 'n_words': 271}