<commit_before><?php

/*
 * This file is part of the SkeletonDancer package.
 *
 * (c) <NAME> <<EMAIL>>
 *
 * This source file is subject to the MIT license that is bundled
 * with this source code in the file LICENSE.
 */

namespace Rollerworks\Tools\SkeletonDancer\Configurator;

use Rollerworks\Tools\SkeletonDancer\Configurator;
use Rollerworks\Tools\SkeletonDancer\Question;
use Rollerworks\Tools\SkeletonDancer\QuestionsSet;
use Rollerworks\Tools\SkeletonDancer\StringUtil;

final class TestingConfigurator implements Configurator
{
    public function interact(QuestionsSet $questions)
    {
        $questions->communicate('enable_phpunit', Question::confirm('Enable PHPUnit?', true));

        if ($questions->communicate('enable_phpspec', Question::confirm('Enable PHPSpec?', false))) {
            $questions->communicate(
                'phpspec_suite_name',
                Question::confirm(
                    'PHPSpec suite-name',
                    function (array $values) {
                        return isset($values['name']) ? StringUtil::shortProductName($values['name']) : null;
                    }
                )
            );
        } else {
            $questions->communicate('phpspec_shortname', null);
        }

        if ($questions->communicate('enable_behat', Question::confirm('Enable Behat?', false))) {
            $questions->communicate(
                'behat_suite_name',
                Question::confirm(
                    'Behat suite-name',
                    function (array $values) {
                        return isset($values['name']) ? StringUtil::shortProductName($values['name']) : null;
                    }
                )
            );
        } else {
            $questions->set('behat_shortname', null);
        }

        $questions->communicate('enable_mink', Question::confirm('Enable Mink?', false));
    }

    public function finalizeConfiguration(array &$configuration)
    {
        if ($configuration['enable_phpunit']) {
            $configuration['composer']['autoload-dev']['psr-4'][$configuration['namespace'].'\\Tests\\'] = 'tests/';
            $configuration['git']['ignore'][] = 'phpunit.xml';
            $configuration['git']['export-ignore'][] = 'phpunit.xml.dist';
            $configuration['git']['export-ignore'][] = 'tests/';
        }
<commit_msg>Fix TestingConfigurator PHP fatal error<commit_after><?php

/*
 * This file is part of the SkeletonDancer package.
 *
 * (c) <NAME> <<EMAIL>>
 *
 * This source file is subject to the MIT license that is bundled
 * with this source code in the file LICENSE.
 */

namespace Rollerworks\Tools\SkeletonDancer\Configurator;

use Rollerworks\Tools\SkeletonDancer\Configurator;
use Rollerworks\Tools\SkeletonDancer\Question;
use Rollerworks\Tools\SkeletonDancer\QuestionsSet;
use Rollerworks\Tools\SkeletonDancer\StringUtil;

final class TestingConfigurator implements Configurator
{
    public function interact(QuestionsSet $questions)
    {
        $questions->communicate('enable_phpunit', Question::confirm('Enable PHPUnit?', true));

        if ($questions->communicate('enable_phpspec', Question::confirm('Enable PHPSpec?', false))) {
            $questions->communicate(
                'phpspec_suite_name',
                Question::confirm(
                    'PHPSpec suite-name',
                    function (array $values) {
                        return isset($values['name']) ? StringUtil::shortProductName($values['name']) : null;
                    }
                )
            );
        } else {
            $questions->set('phpspec_shortname', null);
        }

        if ($questions->communicate('enable_behat', Question::confirm('Enable Behat?', false))) {
            $questions->communicate(
                'behat_suite_name',
                Question::confirm(
                    'Behat suite-name',
                    function (array $values) {
                        return isset($values['name']) ? StringUtil::shortProductName($values['name']) : null;
                    }
                )
            );
        } else {
            $questions->set('behat_shortname', null);
        }

        $questions->communicate('enable_mink', Question::confirm('Enable Mink?', false));
    }

    public function finalizeConfiguration(array &$configuration)
    {
        if ($configuration['enable_phpunit']) {
            $configuration['composer']['autoload-dev']['psr-4'][$configuration['namespace'].'\\Tests\\'] = 'tests/';
            $configuration['git']['ignore'][] = 'phpunit.xml';
            $configuration['git']['export-ignore'][] = 'phpunit.xml.dist';
            $configuration['git']['export-ignore'][] = 'tests/';
        }

{'fraction_non_alphanumeric': 0.13898305084745763, 'fraction_numerical': 0.000423728813559322, 'mean_word_length': 2.393961179007908, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, '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': '4541763', 'n_tokens_mistral': 1290, 'n_tokens_neox': 1220, 'n_words': 230}