<commit_before><?php

namespace Oro\Bundle\EntityBundle\Provider;

use Doctrine\Common\Collections\ArrayCollection;

use Symfony\Component\HttpFoundation\ParameterBag;

class ProviderManager
{
    protected $providers;

    public function __construct()
    {
        $this->providers = new ArrayCollection();
    }

    /**
     * @param AbstractProvider $provider
     */
    public function addProvider(AbstractProvider $provider)
    {
        $this->providers->add($provider);
    }

    /**
     * @param string       $entityName
     * @param ParameterBag $parameters
     *
     * @return AbstractProvider
     */
    public function selectByParams($entityName, ParameterBag $parameters)
    {
        $parameters->set('entityName', $entityName);
        // @TODO: remove this before merge
        $parameters->set('plain-list', '1');

        /** @var AbstractProvider $provider */
        foreach ($this->providers as $provider) {
            if ($provider->isApplied($parameters)) {
                return $provider;
            }
        }

        return $this->providers->first();
    }
} <commit_msg>BAP-4107: Change UX - remove mock<commit_after><?php

namespace Oro\Bundle\EntityBundle\Provider;

use Doctrine\Common\Collections\ArrayCollection;

use Symfony\Component\HttpFoundation\ParameterBag;

class ProviderManager
{
    protected $providers;

    public function __construct()
    {
        $this->providers = new ArrayCollection();
    }

    /**
     * @param AbstractProvider $provider
     */
    public function addProvider(AbstractProvider $provider)
    {
        $this->providers->add($provider);
    }

    /**
     * @param string       $entityName
     * @param ParameterBag $parameters
     *
     * @return AbstractProvider
     */
    public function selectByParams($entityName, ParameterBag $parameters)
    {
        $parameters->set('entityName', $entityName);

        /** @var AbstractProvider $provider */
        foreach ($this->providers as $provider) {
            if ($provider->isApplied($parameters)) {
                return $provider;
            }
        }

        return $this->providers->first();
    }
} 
{'fraction_non_alphanumeric': 0.11979648473635522, 'fraction_numerical': 0.002312673450508788, 'mean_word_length': 2.4663461538461537, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 20, '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': '2272318', 'n_tokens_mistral': 584, 'n_tokens_neox': 567, 'n_words': 117}