<commit_before><?php

namespace Eole\Games\Awale;

use Doctrine\Common\Persistence\ObjectManager;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Eole\Core\Event\PartyEvent;
use Eole\Core\Event\SlotEvent;
use Eole\Core\Service\PartyManager;
use Eole\Games\Awale\Model\AwaleParty;

class EventListener implements EventSubscriberInterface
{
    /**
     * @var ObjectManager
     */
    private $om;

    /**
     * @var PartyManager
     */
    private $partyManager;

    /**
     * @param ObjectManager $om
     */
    public function __construct(ObjectManager $om, PartyManager $partyManager)
    {
        $this->om = $om;
        $this->partyManager = $partyManager;
    }

    /**
     * @param PartyEvent $event
     */
    public function onPartyCreate(PartyEvent $event)
    {
        if ('awale' !== $event->getParty()->getGame()->getName()) {
            return;
        }

        $awaleParty = AwaleParty::createWithSeedsPerContainer(4);

        $awaleParty->setParty($event->getParty());

        $this->om->persist($awaleParty);
    }

    /**
     * @param SlotEvent $event
     */
    public function onPartyJoin(SlotEvent $event)
    {
        if ('awale' !== $event->getParty()->getGame()->getName()) {
            return;
        }

        if ($this->partyManager->isFull($event->getParty())) {
            $this->partyManager->startParty($event->getParty());
        }

        $this->om->persist($event->getParty());
        $this->om->flush();
    }

    /**
     * {@InheritDoc}
     */
    public static function getSubscribedEvents()
    {
        return array(
            PartyEvent::CREATE_BEFORE => array(
                array('onPartyCreate'),
            ),
            SlotEvent::JOIN_AFTER => array(
                array('onPartyJoin'),
            ),
        );
    }
}<commit_msg>codestyle array<commit_after><?php

namespace Eole\Games\Awale;

use Doctrine\Common\Persistence\ObjectManager;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Eole\Core\Event\PartyEvent;
use Eole\Core\Event\SlotEvent;
use Eole\Core\Service\PartyManager;
use Eole\Games\Awale\Model\AwaleParty;

class EventListener implements EventSubscriberInterface
{
    /**
     * @var ObjectManager
     */
    private $om;

    /**
     * @var PartyManager
     */
    private $partyManager;

    /**
     * @param ObjectManager $om
     */
    public function __construct(ObjectManager $om, PartyManager $partyManager)
    {
        $this->om = $om;
        $this->partyManager = $partyManager;
    }

    /**
     * @param PartyEvent $event
     */
    public function onPartyCreate(PartyEvent $event)
    {
        if ('awale' !== $event->getParty()->getGame()->getName()) {
            return;
        }

        $awaleParty = AwaleParty::createWithSeedsPerContainer(4);

        $awaleParty->setParty($event->getParty());

        $this->om->persist($awaleParty);
    }

    /**
     * @param SlotEvent $event
     */
    public function onPartyJoin(SlotEvent $event)
    {
        if ('awale' !== $event->getParty()->getGame()->getName()) {
            return;
        }

        if ($this->partyManager->isFull($event->getParty())) {
            $this->partyManager->startParty($event->getParty());
        }

        $this->om->persist($event->getParty());
        $this->om->flush();
    }

    /**
     * {@InheritDoc}
     */
    public static function getSubscribedEvents()
    {
        return [
            PartyEvent::CREATE_BEFORE => 'onPartyCreate',
            SlotEvent::JOIN_AFTER => 'onPartyJoin',
        ];
    }
}
{'fraction_non_alphanumeric': 0.14728033472803348, 'fraction_numerical': 0.0005578800557880056, 'mean_word_length': 2.3020257826887662, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 53, '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': '1870784', 'n_tokens_mistral': 1130, 'n_tokens_neox': 1058, 'n_words': 166}