<commit_before><?php

namespace Roukmoute\DoctrinePrefixBundle\Subscriber;

use Doctrine\ORM\Event\LoadClassMetadataEventArgs;
use Doctrine\ORM\Id\IdentityGenerator;
use Doctrine\ORM\Id\BigIntegerIdentityGenerator;
use Doctrine\ORM\Id\AssignedGenerator;

class PrefixSubscriber implements \Doctrine\Common\EventSubscriber
{
    protected $prefix = '';
    protected $bundles = [];
    protected $encoding = '';

    /**
     * @param $prefix
     * @param $bundles
     * @param $encoding
     */
    public function __construct($prefix, $bundles, $encoding)
    {
        $this->prefix   = mb_convert_encoding($prefix, $encoding);
        $this->bundles  = $bundles;
        $this->encoding = $encoding;
    }

    /**
     * @return array
     */
    public function getSubscribedEvents()
    {
        return array('loadClassMetadata');
    }

    /**
     * @param LoadClassMetadataEventArgs $args
     */
    public function loadClassMetadata(LoadClassMetadataEventArgs $args)
    {
        /** @var \Doctrine\ORM\Mapping\ClassMetadata $classMetadata */
        $classMetadata = $args->getClassMetadata();

        // Do not re-apply the prefix in an inheritance hierarchy.
        if ($classMetadata->isInheritanceTypeSingleTable() && !$classMetadata->isRootEntity()) {<commit_msg>Add getPrefix() method<commit_after><?php

namespace Roukmoute\DoctrinePrefixBundle\Subscriber;

use Doctrine\ORM\Event\LoadClassMetadataEventArgs;
use Doctrine\ORM\Id\IdentityGenerator;
use Doctrine\ORM\Id\BigIntegerIdentityGenerator;
use Doctrine\ORM\Id\AssignedGenerator;

class PrefixSubscriber implements \Doctrine\Common\EventSubscriber
{
    protected $prefix = '';
    protected $bundles = [];
    protected $encoding = '';

    /**
     * @param $prefix
     * @param $bundles
     * @param $encoding
     */
    public function __construct($prefix, $bundles, $encoding)
    {
        $this->prefix   = mb_convert_encoding($prefix, $encoding);
        $this->bundles  = $bundles;
        $this->encoding = $encoding;
    }

    /**
     * @return string
     */
    public function getPrefix()
    {
        return $this->prefix;
    }

    /**
     * @return array
     */
    public function getSubscribedEvents()
    {
        return array('loadClassMetadata');
    }

    /**
     * @param LoadClassMetadataEventArgs $args
     */
    public function loadClassMetadata(LoadClassMetadataEventArgs $args)
    {
        /** @var \Doctrine\ORM\Mapping\ClassMetadata $classMetadata */
        $classMetadata = $args->getClassMetadata();

        // Do not re-apply the prefix in an inheritance hierarchy.
        if ($classMetadata->isInheritanceTypeSingleTable() && !$classMetadata->isRootEntity()) {
{'fraction_non_alphanumeric': 0.12129080118694362, 'fraction_numerical': 0.0, 'mean_word_length': 3.0074294205052006, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 16, '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': '4993632', 'n_tokens_mistral': 759, 'n_tokens_neox': 749, 'n_words': 149}