<commit_before><?php require __DIR__.'/vendor/autoload.php';

use Symfony\Component\Finder\Finder;
use \Robo\Tasks as TaskList;
use \Robo\Task\GenMarkdownDocTask as Doc;

class RoboFile extends TaskList
{
    const SECONDS = 1000000;

    const SERVER_PORT = 8083;

    /**
     * @desc Start the built-in PHP web server
     */
    public function serve()
    {
        $this->say("Starting the built-in server on localhost:" . self::SERVER_PORT);

        return $this->getServer()->run();
    }

    /**
     * @desc Runs the test suite
     */
    public function test($args = "")
    {
        $this->getServer()->background()->run();

        return $this->rebuildAndRunTests($args);
    }

    /**
     * @desc Runs the test suite (for a CI server)
     */
    public function ci()
    {
        $this->getServer()->background()->run();

        sleep(5);

        return (bool) $this->rebuildAndRunTests("--debug");
    }

    /**
     * @desc watches the directory and reruns the tests when something is
     * changed
     */
    public function tdd($args = "")
    {
        $this->getServer()->background()->run();

        $this->rebuildAndRunTests($args);

        $self    = $this;
        $files   = __DIR__ . "/tests/";
        $lastMod = microtime(true);

        return $this->taskWatch()
            ->monitor($files, function ($event) use ($args, $self, $lastMod) {
                $path                 = (string) $event->getResource()->getResource();

                $extension            = pathinfo($path, PATHINFO_EXTENSION);
                $acceptableExtensions = array("php", "twig", "json");

                if (!in_array($extension, $acceptableExtensions)) {
                    return;
                }

                $isTester = preg_match('/\/\w+Tester\.php$/', $path);
                if ($isTester && ($lastMod - microtime(true) > 5000)) {
                    $self->rebuildTesters();
                    $lastMod = microtime(true);
                }

                return $self->getCodecept()->run($args);
            })
            ->run();
    }

    public function tags()
    {
        return $this->taskExec("phptags")->run();
    }

    public function rebuildTesters()
    {
        return $this->taskExec("./bin/codecept build")->run();
    }

    public function getCodecept()
    {
        return $this->taskCodecept('./bin/codecept');
    }

    private function getServer()
    {
        return $this->taskServer(self::SERVER_PORT)->dir(__DIR__ . "/public");
    }
<commit_msg>Update the serve task in RoboFile to work w/ Silex<commit_after><?php require __DIR__.'/vendor/autoload.php';

use Symfony\Component\Finder\Finder;
use \Robo\Tasks as TaskList;
use \Robo\Task\GenMarkdownDocTask as Doc;

class RoboFile extends TaskList
{
    const SECONDS = 1000000;

    const SERVER_PORT = 8083;

    /**
     * @desc Start the built-in PHP web server
     */
    public function serve()
    {
        $this->say("Starting the built-in server on localhost:" . self::SERVER_PORT);

        return $this->getServer()->run();
    }

    /**
     * @desc Runs the test suite
     */
    public function test($args = "")
    {
        $this->getServer()->background()->run();

        return $this->rebuildAndRunTests($args);
    }

    /**
     * @desc Runs the test suite (for a CI server)
     */
    public function ci()
    {
        $this->getServer()->background()->run();

        sleep(5);

        return (bool) $this->rebuildAndRunTests("--debug");
    }

    /**
     * @desc watches the directory and reruns the tests when something is
     * changed
     */
    public function tdd($args = "")
    {
        $this->getServer()->background()->run();

        $this->rebuildAndRunTests($args);

        $self    = $this;
        $files   = __DIR__ . "/tests/";
        $lastMod = microtime(true);

        return $this->taskWatch()
            ->monitor($files, function ($event) use ($args, $self, $lastMod) {
                $path                 = (string) $event->getResource()->getResource();

                $extension            = pathinfo($path, PATHINFO_EXTENSION);
                $acceptableExtensions = array("php", "twig", "json");

                if (!in_array($extension, $acceptableExtensions)) {
                    return;
                }

                $isTester = preg_match('/\/\w+Tester\.php$/', $path);
                if ($isTester && ($lastMod - microtime(true) > 5000)) {
                    $self->rebuildTesters();
                    $lastMod = microtime(true);
                }

                return $self->getCodecept()->run($args);
            })
            ->run();
    }

    public function tags()
    {
        return $this->taskExec("phptags")->run();
    }

    public function rebuildTesters()
    {
        return $this->taskExec("./bin/codecept build")->run();
    }

    public function getCodecept()
    {
        return $this->taskCodecept('./bin/codecept');
    }

    private function getServer()
    {
        return $this->taskServer(self::SERVER_PORT)
            ->dir(__DIR__ . "/public")
            ->arg(__DIR__ . "/public/index.php");
    }

{'fraction_non_alphanumeric': 0.15398024404416036, 'fraction_numerical': 0.006197946930079411, 'mean_word_length': 1.8688888888888888, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 66, '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': '5058353', 'n_tokens_mistral': 1571, 'n_tokens_neox': 1462, 'n_words': 318}