<commit_before><?php
/**
 * Humbug
 *
 * @category   Humbug
 * @package    Humbug
 * @copyright  Copyright (c) 2015 <NAME> (http://blog.astrumfutura.com)
 * @license    https://github.com/padraic/humbug/blob/master/LICENSE New BSD License
 */

namespace Humbug\PhpSpec\Listener;

use Humbug\PhpSpec\Logger\JsonSpecMapLogger;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use PhpSpec\Event\ExampleEvent;
use PhpSpec\Event\SpecificationEvent;
use PhpSpec\Event\SuiteEvent;

class SpecMapperListener implements EventSubscriberInterface
{

    public function __construct(JsonSpecMapLogger $logger)
    {
        $this->logger = $logger;
    }

    public static function getSubscribedEvents()
    {
        return [
            'afterSpecification' => ['afterSpecification', -10],
            'afterSuite' => ['afterSuite', -10]
        ];
    }

    public function afterSpecification(SpecificationEvent $event)
    {
        $node = $event->getSpecification();
        $resource = $node->getResource();
        $this->logger->logSpecification(
            $resource->getSrcFilename(),
            $node->getTitle(),
            $node->getClassReflection()->name,
            $resource->getSrcNamespace() . '\\' . $resource->getSrcClassname()
        );
    }

    public function afterSuite(SuiteEvent $event)
    {
        $this->logger->write();
    }
}<commit_msg>remove namespace<commit_after><?php
/**
 * Humbug
 *
 * @category   Humbug
 * @package    Humbug
 * @copyright  Copyright (c) 2015 <NAME> (http://blog.astrumfutura.com)
 * @license    https://github.com/padraic/humbug/blob/master/LICENSE New BSD License
 */

namespace Humbug\PhpSpec\Listener;

use Humbug\PhpSpec\Logger\JsonSpecMapLogger;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use PhpSpec\Event\ExampleEvent;
use PhpSpec\Event\SpecificationEvent;
use PhpSpec\Event\SuiteEvent;

class SpecMapperListener implements EventSubscriberInterface
{

    public function __construct(JsonSpecMapLogger $logger)
    {
        $this->logger = $logger;
    }

    public static function getSubscribedEvents()
    {
        return [
            'afterSpecification' => ['afterSpecification', -10],
            'afterSuite' => ['afterSuite', -10]
        ];
    }

    public function afterSpecification(SpecificationEvent $event)
    {
        $node = $event->getSpecification();
        $resource = $node->getResource();
        $this->logger->logSpecification(
            $resource->getSrcFilename(),
            $node->getTitle(),
            $node->getClassReflection()->name,
            $resource->getSrcClassname()
        );
    }

    public function afterSuite(SuiteEvent $event)
    {
        $this->logger->write();
    }
}
{'fraction_non_alphanumeric': 0.1269667032564947, 'fraction_numerical': 0.005854372484449323, 'mean_word_length': 2.933812949640288, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 34, 'https://': 2, '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': '3865159', 'n_tokens_mistral': 812, 'n_tokens_neox': 792, 'n_words': 138}