<commit_before><?php

/*
 * This file is part of the Meta package.
 *
 * (c) Anekdotes Communication inc. <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Tests;

use Anekdotes\Meta\Dispatcher;
use PHPUnit_Framework_TestCase;

class DispatcherTest extends PHPUnit_Framework_TestCase
{

    public function testDispatcherProcedure()
    {
        $test = "test";
        $test2 = "test";
        $closure = function() use (&$test){
            $test .= "s";
        };
        $closure2 = function() use (&$test2){
            $test2 .= "v";
        };
        $dispatcher = new Dispatcher();
        $dispatcher->listen('fire',$closure);
        $dispatcher->listen('fire',$closure2);
        $dispatcher->fire('fire');
        $this->assertEquals($test,"tests");
        $this->assertEquals($test2,"testv");
        $dispatcher->listen('toast',$closure);
        $dispatcher->flush('fire');
        $dispatcher->fire('fire');
        $dispatcher->fire('toast');
        $this->assertEquals($test,"testss");
        $this->assertEquals($test2,"testv");
        $dispatcher->flush();
        $dispatcher->fire('toast');
        $this->assertEquals($test,"testss");
        $this->assertEquals($test2,"testv");
    }

    public function testEmptyFire(){
        $dispatcher = new Dispatcher();
        $this->assertFalse($dispatcher->fire('test'));
    }

}<commit_msg>Applied fixes from StyleCI (#2)<commit_after><?php

/*
 * This file is part of the Meta package.
 *
 * (c) Anekdotes Communication inc. <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Tests;

use Anekdotes\Meta\Dispatcher;
use PHPUnit_Framework_TestCase;

class DispatcherTest extends PHPUnit_Framework_TestCase
{
    public function testDispatcherProcedure()
    {
        $test = 'test';
        $test2 = 'test';
        $closure = function () use (&$test) {
            $test .= 's';
        };
        $closure2 = function () use (&$test2) {
            $test2 .= 'v';
        };
        $dispatcher = new Dispatcher();
        $dispatcher->listen('fire', $closure);
        $dispatcher->listen('fire', $closure2);
        $dispatcher->fire('fire');
        $this->assertEquals($test, 'tests');
        $this->assertEquals($test2, 'testv');
        $dispatcher->listen('toast', $closure);
        $dispatcher->flush('fire');
        $dispatcher->fire('fire');
        $dispatcher->fire('toast');
        $this->assertEquals($test, 'testss');
        $this->assertEquals($test2, 'testv');
        $dispatcher->flush();
        $dispatcher->fire('toast');
        $this->assertEquals($test, 'testss');
        $this->assertEquals($test2, 'testv');
    }

    public function testEmptyFire()
    {
        $dispatcher = new Dispatcher();
        $this->assertFalse($dispatcher->fire('test'));
    }
}
{'fraction_non_alphanumeric': 0.16398390342052313, 'fraction_numerical': 0.005700871898054996, 'mean_word_length': 2.771175726927939, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 41, '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': '3482235', 'n_tokens_mistral': 868, 'n_tokens_neox': 849, 'n_words': 187}