<commit_before><?php
/*
 * This file is part of the Black package.
 *
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Black\Component\Page\Infrastructure\Listener;

use Black\Component\Page\Domain\Event\WebPageCreatedEvent;
use Monolog\Logger;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;

/**
 * Class WebPageCreatedListener
 *
 * @author  Alexandre 'pocky' Balmes <<EMAIL>>
 * @license http://opensource.org/licenses/mit-license.php MIT
 */
class WebPageCreatedListener implements EventSubscriberInterface
{
    protected $logger;

    /**
     * @param Logger $logger
     */
    public function __construct(Logger $logger)
    {
        $this->logger = $logger;
    }

    /**
     * @return array
     */
    public static function getSubscribedEvents()
    {
        return [
            'web_page.created' => [
                'onWebPageCreated', 0
            ]
        ];
    }

    /**
     * @param WebPageCreatedEvent $event
     * @return mixed
     */
    public function onWebPageCreated(WebPageCreatedEvent $event)
    {
        $this->logger->info($event->execute());

        return $event->getWebPageId();
    }
}
<commit_msg>Fix Listener<commit_after><?php
/*
 * This file is part of the Black package.
 *
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Black\Component\Page\Infrastructure\Listener;

use Black\Component\Page\Domain\Event\WebPageCreatedEvent;
use Monolog\Logger;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;

/**
 * Class WebPageCreatedListener
 *
 * @author  Alexandre 'pocky' Balmes <<EMAIL>>
 * @license http://opensource.org/licenses/mit-license.php MIT
 */
class WebPageCreatedListener implements EventSubscriberInterface
{
    protected $logger;

    /**
     * @param Logger $logger
     */
    public function __construct(Logger $logger)
    {
        $this->logger = $logger;
    }

    /**
     * @return array
     */
    public static function getSubscribedEvents()
    {
        return [
            'web_page.created' => [
                'onWebPageCreated', 0
            ]
        ];
    }

    /**
     * @param WebPageCreatedEvent $event
     * @return mixed
     */
    public function onWebPageCreated(WebPageCreatedEvent $event)
    {
        $this->logger->info($event->execute());
    }
}

{'fraction_non_alphanumeric': 0.11546065638592329, 'fraction_numerical': 0.0007908264136022143, 'mean_word_length': 2.677325581395349, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 24, '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': '7323351', 'n_tokens_mistral': 725, 'n_tokens_neox': 715, 'n_words': 171}