<commit_before><?php

namespace Cubalider\Component\Money\Manager;

use Doctrine\ORM\EntityManagerInterface;

/**
 * @author <NAME> <<EMAIL>>
 */
class CurrencyManager implements CurrencyManagerInterface
{
    /**
     * @var \Doctrine\ORM\EntityManagerInterface
     */
    private $em;

    /**
     * @var \Doctrine\ORM\EntityRepository
     */
    private $repository;

    /**
     * Constructor.
     * Additionally it creates a repository using $em, for given class.
     *
     * @param EntityManagerInterface $em
     */
    public function __construct(EntityManagerInterface $em)
    {
        $this->em = $em;
        $this->repository = $this->em->getRepository('Cubalider\Component\Money\Model\Currency');
    }

    /**
     * Picks a currency using given criteria
     *
     * @param string|array $criteria
     * @return mixed
     */
    public function pick($criteria)
    {
        if (is_string($criteria)) {
            $criteria = array('code' => $criteria);
        }

        return $this->repository->findOneBy($criteria);
    }
}<commit_msg>Replaced EntityManagerInterface by EntityManager to get access to "find" functions<commit_after><?php

namespace Cubalider\Component\Money\Manager;

use Doctrine\ORM\EntityManager;

/**
 * @author <NAME> <<EMAIL>>
 */
class CurrencyManager implements CurrencyManagerInterface
{
    /**
     * @var \Doctrine\ORM\EntityManager
     */
    private $em;

    /**
     * @var \Doctrine\ORM\EntityRepository
     */
    private $repository;

    /**
     * Constructor.
     * Additionally it creates a repository using $em, for entity class.
     *
     * @param EntityManager $em
     */
    public function __construct(EntityManager $em)
    {
        $this->em = $em;
        $this->repository = $this->em->getRepository('Cubalider\Component\Money\Model\Currency');
    }

    /**
     * Picks a currency using given criteria
     *
     * @param string|array $criteria
     * @return mixed
     */
    public function pick($criteria)
    {
        if (is_string($criteria)) {
            $criteria = array('code' => $criteria);
        }

        return $this->repository->findOneBy($criteria);
    }
}

{'fraction_non_alphanumeric': 0.12897282358360201, 'fraction_numerical': 0.0, 'mean_word_length': 2.4752, 'pattern_counts': {'":': 0, '<': 11, '<?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': '3136688', 'n_tokens_mistral': 644, 'n_tokens_neox': 633, 'n_words': 135}