<commit_before><?php

namespace SeoManager;

use Doctrine\ORM\EntityManager,
    Doctrine\ORM\Tools\SchemaTool;

class SeoManager
{
    protected $entityManager;

    public function __construct(EntityManager $entityManager)
    {
        $this->entityManager = $entityManager;
        $this->checkIfTablesExist();
    }

    private function checkIfTablesExist()
    {
        $schemaManager = $this->entityManager->getConnection()->getSchemaManager();

        if ($schemaManager->tablesExist(array('SeoManager')) != true) {
            $tool = new SchemaTool($this->entityManager);
            $classes = array(
                $this->entityManager->getClassMetadata('SeoManager\Entity'),
            );
            $tool->createSchema($classes);
        }
    }

    public function getMetaTags($basePath)
    {
        $seoManagerRepository = $this->entityManager->getRepository('SeoManager\Entity\SeoManager');
        $seoManager = $seoManagerRepository->findOneBy(array('url' => $basePath));
        if ($seoManager) {
            return [
              'title'=> $seoManager->getTitle(),
              'description'=> $seoManager->getDescription(),
              'keywords'=> $seoManager->getKeywords(),
            ];
        }
    }
}
<commit_msg>update error getClassMetadata<commit_after><?php

namespace SeoManager;

use Doctrine\ORM\EntityManager,
    Doctrine\ORM\Tools\SchemaTool;

class SeoManager
{
    protected $entityManager;

    public function __construct(EntityManager $entityManager)
    {
        $this->entityManager = $entityManager;
        $this->checkIfTablesExist();
    }

    private function checkIfTablesExist()
    {
        $schemaManager = $this->entityManager->getConnection()->getSchemaManager();

        if ($schemaManager->tablesExist(array('SeoManager')) != true) {
            $tool = new SchemaTool($this->entityManager);
            $classes = array(
                $this->entityManager->getClassMetadata('SeoManager\Entity\SeoManager'),
            );
            $tool->createSchema($classes);
        }
    }

    public function getMetaTags($basePath)
    {
        $seoManagerRepository = $this->entityManager->getRepository('SeoManager\Entity\SeoManager');
        $seoManager = $seoManagerRepository->findOneBy(array('url' => $basePath));
        if ($seoManager) {
            return [
              'title'=> $seoManager->getTitle(),
              'description'=> $seoManager->getDescription(),
              'keywords'=> $seoManager->getKeywords(),
            ];
        }
    }
}

{'fraction_non_alphanumeric': 0.1340935902477389, 'fraction_numerical': 0.0, 'mean_word_length': 2.623931623931624, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 43, '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': '7615635', 'n_tokens_mistral': 695, 'n_tokens_neox': 690, 'n_words': 100}