<commit_before><?php

namespace Oro\Bundle\EntityExtendBundle\Tools;

use Doctrine\Common\Persistence\ManagerRegistry;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\Query;
use Gedmo\Translatable\Query\TreeWalker\TranslationWalker;
use Gedmo\Translatable\TranslatableListener;
use Oro\Bundle\EntityConfigBundle\Config\ConfigInterface;
use Oro\Bundle\EntityConfigBundle\Config\ConfigManager;
use Oro\Bundle\EntityConfigBundle\Config\Id\FieldConfigId;
use Oro\Bundle\EntityConfigBundle\Translation\ConfigTranslationHelper;
use Oro\Bundle\EntityExtendBundle\Entity\AbstractEnumValue;
use Oro\Bundle\EntityExtendBundle\Entity\Repository\EnumValueRepository;
use Oro\Bundle\TranslationBundle\Translation\TranslatableQueryTrait;
use Oro\Bundle\TranslationBundle\Translation\Translator;
use Symfony\Component\Translation\TranslatorInterface;

/**
 * Manage fields enum, update and sync
 *
 * @SuppressWarnings(PHPMD.ExcessiveClassComplexity)
 */
class EnumSynchronizer
{
    use TranslatableQueryTrait;

    /** @var ConfigManager */
    protected $configManager;

    /** @var ManagerRegistry */
    protected $doctrine;

    /** @var TranslatorInterface */
    protected $translator;

    /** @var ConfigTranslationHelper */
    protected $translationHelper;

    /**
     * @param ConfigManager $configManager
     * @param ManagerRegistry $doctrine<commit_msg>BB-15567: Import of product attributes recreates enum values<commit_after><?php

namespace Oro\Bundle\EntityExtendBundle\Tools;

use Doctrine\Common\Persistence\ManagerRegistry;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\Query;
use Gedmo\Translatable\Query\TreeWalker\TranslationWalker;
use Gedmo\Translatable\TranslatableListener;
use Oro\Bundle\EntityConfigBundle\Config\ConfigInterface;
use Oro\Bundle\EntityConfigBundle\Config\ConfigManager;
use Oro\Bundle\EntityConfigBundle\Config\Id\FieldConfigId;
use Oro\Bundle\EntityConfigBundle\Translation\ConfigTranslationHelper;
use Oro\Bundle\EntityExtendBundle\Entity\AbstractEnumValue;
use Oro\Bundle\EntityExtendBundle\Entity\Repository\EnumValueRepository;
use Oro\Bundle\TranslationBundle\Translation\TranslatableQueryTrait;
use Oro\Bundle\TranslationBundle\Translation\Translator;
use Symfony\Component\Translation\TranslatorInterface;

/**
 * This class contains logic of enum configuration, options and translations synchronization
 * @SuppressWarnings(PHPMD.ExcessiveClassComplexity)
 */
class EnumSynchronizer
{
    use TranslatableQueryTrait;

    /** @var ConfigManager */
    protected $configManager;

    /** @var ManagerRegistry */
    protected $doctrine;

    /** @var TranslatorInterface */
    protected $translator;

    /** @var ConfigTranslationHelper */
    protected $translationHelper;

    /**
     * @param ConfigManager $configManager
     * @param ManagerRegistry $doctrine
{'fraction_non_alphanumeric': 0.09197443181818182, 'fraction_numerical': 0.0017755681818181818, 'mean_word_length': 5.612676056338028, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '2558982', 'n_tokens_mistral': 799, 'n_tokens_neox': 781, 'n_words': 139}