Symfony Exception

ClassNotFoundError

HTTP 500 Internal Server Error

Attempted to load class "Response" from namespace "App\Controller".
Did you forget a "use" statement for e.g. "Symfony\Flex\Response", "Symfony\Component\HttpFoundation\Response", "Symfony\Component\BrowserKit\Response", "ReCaptcha\Response", "Mpdf\PsrHttpMessageShim\Response" or "GuzzleHttp\Psr7\Response"?

Exception

Symfony\Component\ErrorHandler\Error\ ClassNotFoundError

  1.      * @access public
  2.      * @return void
  3.      */
  4.     public function action_presentation_edit($slug nullRequest $requestTheatreMail $TheatreMailUtilsEdit $edit_utilsImages $imagesEditUtils $editUtils)
  5.     {
  6.         return $this->redirectToRoute('index', [], Response::HTTP_MOVED_PERMANENTLY);
  7.     }
  8.     // }}}
  9.     // {{{ action_presentation()
  1.         $this->dispatcher->dispatch($eventKernelEvents::CONTROLLER_ARGUMENTS);
  2.         $controller $event->getController();
  3.         $arguments $event->getArguments();
  4.         // call controller
  5.         $response $controller(...$arguments);
  6.         // view
  7.         if (!$response instanceof Response) {
  8.             $event = new ViewEvent($this$request$type$response);
  9.             $this->dispatcher->dispatch($eventKernelEvents::VIEW);
  1.     {
  2.         $request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
  3.         $this->requestStack->push($request);
  4.         try {
  5.             return $this->handleRaw($request$type);
  6.         } catch (\Exception $e) {
  7.             if ($e instanceof RequestExceptionInterface) {
  8.                 $e = new BadRequestHttpException($e->getMessage(), $e);
  9.             }
  10.             if (false === $catch) {
  1.         $this->boot();
  2.         ++$this->requestStackSize;
  3.         $this->resetServices true;
  4.         try {
  5.             return $this->getHttpKernel()->handle($request$type$catch);
  6.         } finally {
  7.             --$this->requestStackSize;
  8.         }
  9.     }
  1.     Debug::enable();
  2. }
  3. $kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
  4. $request Request::createFromGlobals();
  5. $response $kernel->handle($request);
  6. $response->send();
  7. $kernel->terminate($request$response);

Stack Trace

ClassNotFoundError
Symfony\Component\ErrorHandler\Error\ClassNotFoundError:
Attempted to load class "Response" from namespace "App\Controller".
Did you forget a "use" statement for e.g. "Symfony\Flex\Response", "Symfony\Component\HttpFoundation\Response", "Symfony\Component\BrowserKit\Response", "ReCaptcha\Response", "Mpdf\PsrHttpMessageShim\Response" or "GuzzleHttp\Psr7\Response"?

  at /home/web/theatre-contemporain.net/dev/src/Controller/BiographieController.php:2032
  at App\Controller\BiographieController->action_presentation_edit()
     (/home/web/theatre-contemporain.net/dev/vendor/symfony/http-kernel/HttpKernel.php:163)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw()
     (/home/web/theatre-contemporain.net/dev/vendor/symfony/http-kernel/HttpKernel.php:75)
  at Symfony\Component\HttpKernel\HttpKernel->handle()
     (/home/web/theatre-contemporain.net/dev/vendor/symfony/http-kernel/Kernel.php:202)
  at Symfony\Component\HttpKernel\Kernel->handle()
     (/home/web/theatre-contemporain.net/dev/public/index.php:20)