Erro: Fatal error: Uncaught Error: Class "Doctrine\ORM\Tools\Setup" not found in C:\Users\Erik Monteiro\Documents\Programação\PHP\mvc\src\Infra\EntityManagerCreator.php:21 Stack trace: #0 C:\Users\Erik Monteiro\Documents\Programação\PHP\mvc\public\listar-cursos.php(5): Alura\Cursos\Infra\EntityManagerCreator->getEntityManager() #1 {main} thrown in C:\Users\Erik Monteiro\Documents\Programação\PHP\mvc\src\Infra\EntityManagerCreator.php on line 21
lista-cursos.php
<?php
require __DIR__ . '/../vendor/autoload.php';
$entityManager = (new \Alura\Cursos\Infra\EntityManagerCreator())->getEntityManager();
$repositorioDeCursos = $entityManager->getRepository(\Alura\Cursos\Entity\Curso::class);
$cursos = $repositorioDeCursos->findAll();
?>
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8">
<title>Document</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
</head>
<body>
<div class="container">
<div class="jumbotron">
<h1>Listar cursos</h1>
</div>
<a href="/novo-curso" class="btn btn-primary mb-2">
Novo curso
</a>
<ul class="list-group">
<?php foreach ($cursos as $curso): ?>
<li class="list-group-item">
<?= $curso->getDescricao(); ?>
</li>
<?php endforeach; ?>
</ul>
</div>
</body>
</html>
EntityManagerCreator.php
<?php
namespace Alura\Cursos\Infra;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\Tools\Setup;
class EntityManagerCreator
{
public function getEntityManager(): EntityManagerInterface
{
$paths = [__DIR__ . '/../Entity'];
$isDevMode = false;
$dbParams = array(
'driver' => 'pdo_sqlite',
'path' => __DIR__ . '/../../db.sqlite'
);
$config = Setup::createAnnotationMetadataConfiguration(
$paths,
$isDevMode
);
return EntityManager::create($dbParams, $config);
}
}
OBS: já executei o comando "composer dump-autoload" e minha estrutura de pastas está igual a do tutorial.