Olá, ao abrir o teste.php da aula me retorna este erro
Fatal error: Uncaught Error: Class "Doctrine\Common\Annotations\AnnotationRegistry" not found in C:\xampp\htdocs\Alura\9 - Doctrine ORM Acesse o banco com mapeamento objeto relacional\vendor\doctrine\orm\lib\Doctrine\ORM\Configuration.php:165
Stack trace:
#0 C:\xampp\htdocs\Alura\9 - Doctrine ORM Acesse o banco com mapeamento objeto relacional\vendor\doctrine\orm\lib\Doctrine\ORM\Tools\Setup.php(75): Doctrine\ORM\Configuration->newDefaultAnnotationDriver(Array, true)
#1 C:\xampp\htdocs\Alura\9 - Doctrine ORM Acesse o banco com mapeamento objeto relacional\src\Helper\EntityManagerFactory.php(20): Doctrine\ORM\Tools\Setup::createAnnotationMetadataConfiguration(Array, true)
#2 C:\xampp\htdocs\Alura\9 - Doctrine ORM Acesse o banco com mapeamento objeto relacional\teste.php(10): Alura\Doctrine\Helper\EntityManagerFactory->getEntityManager()
#3 {main}
thrown in C:\xampp\htdocs\Alura\9 - Doctrine ORM Acesse o banco com mapeamento objeto relacional\vendor\doctrine\orm\lib\Doctrine\ORM\Configuration.php on line 165
Copiei o código do professor e colei por cima do meu, mas não encontrei diferenças, alguém poderia me auxiliar?
Teste.php
<?php
use Alura\Doctrine\Helper\EntityManagerFactory;
require_once __DIR__ . '/vendor/autoload.php';
echo "<pre>";
$entityManagerFactory = new EntityManagerFactory();
$entityManager = $entityManagerFactory->getEntityManager();
var_dump($entityManager->getConnection());
EntityManagerFactory.php
<?php
namespace Alura\Doctrine\Helper;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\Tools\Setup;
/**
* @return EntityMangerInterface
* @throws \Doctrine\ORM\ORMException
*/
class EntityManagerFactory
{
public function getEntityManager(): EntityManagerInterface
{
$rootDir = __DIR__ . '/../..';
$config = Setup::createAnnotationMetadataConfiguration(
[$rootDir . '/src'],
true
);
$connection = [
'driver' => 'pdo_sqlite',
'path' => $rootDir . '/var/data/banco.sqlite'
];
return EntityManager::create($connection, $config);
}
}