<commit_before><?php
declare(strict_types=1);

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

namespace Al\Infrastructure\Employee\Repository;

use Al\Component\Employee\Employee;
use Al\Component\Employee\Exception\NotExistingEmployee;
use Doctrine\ORM\EntityManager;
use Al\Component\Employee\EmployeeInterface;
use Al\Component\Employee\EmployeeRepositoryInterface;
use Ramsey\Uuid\Uuid;

final class EmployeeRepository implements EmployeeRepositoryInterface
{
    /** @var EntityManager */
    private $entityManager;

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

    /**
     * {@inheritdoc}
     */
    public function get(Uuid $identifier)
    {
        if (null === $employee = $this->entityManager->find(Employee::class, (string) $identifier->toString())) {
            throw new NotExistingEmployee((string) $identifier->toString());
        }

        return $employee;
    }

    /**
     * {@inheritdoc}
     */
    public function add(EmployeeInterface $employee)
    {
        $this->entityManager->persist($employee);
        $this->entityManager->flush();<commit_msg>Small fix<commit_after><?php
declare(strict_types=1);

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

namespace Al\Infrastructure\Employee\Repository;

use Al\Component\Employee\Employee;
use Al\Component\Employee\Exception\NotExistingEmployee;
use Al\Component\Employee\EmployeeInterface;
use Al\Component\Employee\EmployeeRepositoryInterface;
use Doctrine\ORM\EntityManagerInterface;
use Ramsey\Uuid\Uuid;

final class EmployeeRepository implements EmployeeRepositoryInterface
{
    /** @var EntityManagerInterface */
    private $entityManager;

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

    /**
     * {@inheritdoc}
     */
    public function get(Uuid $identifier)
    {
        if (null === $employee = $this->entityManager->find(Employee::class, (string) $identifier->toString())) {
            throw new NotExistingEmployee((string) $identifier->toString());
        }

        return $employee;
    }

    /**
     * {@inheritdoc}
     */
    public function add(EmployeeInterface $employee)
    {
        $this->entityManager->persist($employee);
        $this->entityManager->flush();
{'fraction_non_alphanumeric': 0.11671469740634005, 'fraction_numerical': 0.0007204610951008645, 'mean_word_length': 3.407936507936508, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 23, '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': '5998943', 'n_tokens_mistral': 778, 'n_tokens_neox': 729, 'n_words': 176}