<commit_before><?php

namespace EVT\CoreDomainBundle\Repository;

use EVT\CoreDomainBundle\Events\ShowroomEvent;
use EVT\CoreDomainBundle\Events\Event;
use EVT\CoreDomain\Provider\ShowroomRepositoryInterface as DomainRepository;
use Doctrine\ORM\EntityRepository;
use EVT\CoreDomainBundle\Mapping\ShowroomMapping;
use BDK\AsyncDispatcherBundle\Model\EventDispatcher\AsyncEventDispatcherInterface;

/**
 * Class ShowroomRepository
 * @author <NAME> <<EMAIL>>
 * @copyright 2014 Bodaclick
 */
class ShowroomRepository extends EntityRepository implements DomainRepository
{

    private $mapping;
    private $asyncDispatcher;

    public function setAsyncDispatcher(AsyncEventDispatcherInterface $asyncDispatcher)
    {
        $this->asyncDispatcher = $asyncDispatcher;
    }

    public function save($showroom)
    {
        $entity = $this->mapping->mapDomainToEntity($showroom);
        $this->_em->persist($entity);
        $this->_em->flush();

        $eventName = Event::onCreateShowroom;
        if (!empty($showroom->getId())) {
            $eventName = Event::onUpdateShowroom;
        }

        $this->setId($entity->getId(), $showroom);

        $event = new ShowroomEvent($showroom, $eventName);
        $this->asyncDispatcher->dispatch($event);
    }

    public function delete($showroom)
    {
    }

    public function update($showroom)
    {
    }

    public function findOneById($id)
    {
        if (!$showroom = parent::findOneById($id)) {
            return null;
        }
        return $this->mapper->mapEntityToDomain($showroom);
    }

    public function findAll()
    {
    }

    public function setMapper(ShowroomMapping $mapping)
    {
        $this->mapping = $mapping;
    }

    private function setId($id, $showroom)
    {
        $rflShowroom = new \ReflectionClass($showroom);
        $rflId = $rflShowroom->getProperty('id');
        $rflId->setAccessible(true);
        $rflId->setValue($showroom, $id);
    }
}
<commit_msg>[#EVT-9] - Typo in mapper<commit_after><?php

namespace EVT\CoreDomainBundle\Repository;

use EVT\CoreDomainBundle\Events\ShowroomEvent;
use EVT\CoreDomainBundle\Events\Event;
use EVT\CoreDomain\Provider\ShowroomRepositoryInterface as DomainRepository;
use Doctrine\ORM\EntityRepository;
use EVT\CoreDomainBundle\Mapping\ShowroomMapping;
use BDK\AsyncDispatcherBundle\Model\EventDispatcher\AsyncEventDispatcherInterface;

/**
 * Class ShowroomRepository
 * @author <NAME> <<EMAIL>>
 * @copyright 2014 Bodaclick
 */
class ShowroomRepository extends EntityRepository implements DomainRepository
{

    private $mapping;
    private $asyncDispatcher;

    public function setAsyncDispatcher(AsyncEventDispatcherInterface $asyncDispatcher)
    {
        $this->asyncDispatcher = $asyncDispatcher;
    }

    public function save($showroom)
    {
        $entity = $this->mapping->mapDomainToEntity($showroom);
        $this->_em->persist($entity);
        $this->_em->flush();

        $eventName = Event::onCreateShowroom;
        if (!empty($showroom->getId())) {
            $eventName = Event::onUpdateShowroom;
        }

        $this->setId($entity->getId(), $showroom);

        $event = new ShowroomEvent($showroom, $eventName);
        $this->asyncDispatcher->dispatch($event);
    }

    public function delete($showroom)
    {
    }

    public function update($showroom)
    {
    }

    public function findOneById($id)
    {
        if (!$showroom = parent::findOneById($id)) {
            return null;
        }
        return $this->mapping->mapEntityToDomain($showroom);
    }

    public function findAll()
    {
    }

    public function setMapper(ShowroomMapping $mapping)
    {
        $this->mapping = $mapping;
    }

    private function setId($id, $showroom)
    {
        $rflShowroom = new \ReflectionClass($showroom);
        $rflId = $rflShowroom->getProperty('id');
        $rflId->setAccessible(true);
        $rflId->setValue($showroom, $id);
    }
}

{'fraction_non_alphanumeric': 0.12332236009116232, 'fraction_numerical': 0.002279057989364396, 'mean_word_length': 3.2066027689030885, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 45, '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': '6611917', 'n_tokens_mistral': 1178, 'n_tokens_neox': 1130, 'n_words': 199}