<commit_before><?php

namespace Fazland\ElasticaBundle\Doctrine;

use Doctrine\Common\Persistence\ManagerRegistry;
use Fazland\ElasticaBundle\Transformer\ObjectFetcherInterface;

class ObjectFetcher implements ObjectFetcherInterface
{
    /**
     * @var ManagerRegistry
     */
    private $doctrine;

    /**
     * @var string
     */
    private $objectClass;

    public function __construct(ManagerRegistry $doctrine, string $objectClass)
    {
        $this->doctrine = $doctrine;
        $this->objectClass = $objectClass;
    }

    /**
     * @inheritDoc
     */
    public function find(...$identifiers)
    {
        $results = [];
        $manager = $this->doctrine->getManagerForClass($this->objectClass);

        foreach ($identifiers as $identifier) {
            $results[$identifier] = $manager->find($this->objectClass, explode(' ', $identifier));
        }
<commit_msg>fix identifier retrieval in ObjectFetcher<commit_after><?php

namespace Fazland\ElasticaBundle\Doctrine;

use Doctrine\Common\Persistence\ManagerRegistry;
use Fazland\ElasticaBundle\Transformer\ObjectFetcherInterface;

class ObjectFetcher implements ObjectFetcherInterface
{
    /**
     * @var ManagerRegistry
     */
    private $doctrine;

    /**
     * @var string
     */
    private $objectClass;

    public function __construct(ManagerRegistry $doctrine, string $objectClass)
    {
        $this->doctrine = $doctrine;
        $this->objectClass = $objectClass;
    }

    /**
     * @inheritDoc
     */
    public function find(...$identifiers)
    {
        $results = [];
        $manager = $this->doctrine->getManagerForClass($this->objectClass);

        foreach ($identifiers as $identifier) {
            $identifier = explode(' ', $identifier);
            if (1 === count($identifier)) {
                $identifier = reset($identifier);
            }

            $results[$identifier] = $manager->find($this->objectClass, $identifier);
        }

{'fraction_non_alphanumeric': 0.12576687116564417, 'fraction_numerical': 0.0005112474437627812, 'mean_word_length': 2.734732824427481, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, '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': '3372894', 'n_tokens_mistral': 547, 'n_tokens_neox': 544, 'n_words': 99}