Я долго искал в сети, но не понял своей ошибки. Не могли бы вы помочь мне ?
Я использую Symfony 3.4
Ошибка :
(1/1) RuntimeException
The autoloader expected class "AppBundle\Controller\MessagingController" to be defined in file "/home/thomas/Documents/Projects/ludiproject_api/vendor/composer/../../src/AppBundle/Controller/MessagingController.php".
The file was found but the class was not in it, the class name or namespace probably has a typo.
Вот моя сущность:
<?php
namespace AppBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* AppBundle\Entity\Messaging
*
* @ORM\Table(name = "messaging")
* @ORM\Entity(repositoryClass = "AppBundle\Repository\MessagingRepository")
*/
class Messaging
{
Вот мой контроллер:
namespace AppBundle\Controller;
use AppBundle\Entity\Messaging;
use DateTime;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\JsonResponse;
use FOS\RestBundle\Controller\Annotations as Rest;
class MessagingController extends Controller
{
Вот мой репозиторий:
namespace AppBundle\Repository;
use Doctrine\ORM\EntityRepository;
class MessagingRepository extends EntityRepository
{






Я нашел это !
Необходимо добавить "repository-class =" AppBundle \ Repository \ MessagingRepository "в Messaging.orm.xml.
<entity name = "AppBundle\Entity\Messaging" table = "messaging" repository-class = "AppBundle\Repository\MessagingRepository">
Можете ли вы скопировать / вставить
autoload>psr-4из вашего composer.json?