Symfony Exception

UndefinedMethodError

HTTP 500 Internal Server Error

Attempted to call an undefined method named "getRequest" of class "App\Controller\InvestmentController".

Exception

Symfony\Component\ErrorHandler\Error\ UndefinedMethodError

  1.     
  2.     /**
  3.      * @Route("/investments/search/{manager2}", name="frontend_searchinvestmentresults25")
  4.      */
  5.     public function searchInvestmentResults25(Request $request$manager2 "",$extras "") {
  6.         if($this->getRequest()->getHost()=="https://www.smartmoneymatch.com"){
  7.                                                         $baseurls "https://".$this->getRequest()->getHost();
  8.                                                     } 
  9.                                                     else if($this->getRequest()->getHost()=="www.smartmoneymatch.com"){
  10.                                                         $baseurls "https://".$this->getRequest()->getHost();
  11.                                                     }
in vendor/symfony/http-kernel/HttpKernel.php -> searchInvestmentResults25 (line 181)
  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$event);
  9.             $this->dispatcher->dispatch($eventKernelEvents::VIEW);
  1.         $request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
  2.         $this->requestStack->push($request);
  3.         $response null;
  4.         try {
  5.             return $response $this->handleRaw($request$type);
  6.         } catch (\Throwable $e) {
  7.             if ($e instanceof \Error && !$this->handleAllThrowables) {
  8.                 throw $e;
  9.             }
  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.     ) {
  2.     }
  3.     public function run(): int
  4.     {
  5.         $response $this->kernel->handle($this->request);
  6.         if (Kernel::VERSION_ID >= 60400) {
  7.             $response->send(false);
  8.             if (\function_exists('fastcgi_finish_request') && !$this->debug) {
in vendor/autoload_runtime.php -> run (line 29)
  1. $app $app(...$args);
  2. exit(
  3.     $runtime
  4.         ->getRunner($app)
  5.         ->run()
  6. );
require_once('/usr/www/users/smartm/vendor/autoload_runtime.php') in public/index.php (line 5)
  1. <?php
  2. umask(0000);
  3. use App\Kernel;
  4. require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
  5. return function (array $context) {
  6.     return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
  7. };

Stack Trace

UndefinedMethodError
Symfony\Component\ErrorHandler\Error\UndefinedMethodError:
Attempted to call an undefined method named "getRequest" of class "App\Controller\InvestmentController".

  at src/Controller/InvestmentController.php:18846
  at App\Controller\InvestmentController->searchInvestmentResults25()
     (vendor/symfony/http-kernel/HttpKernel.php:181)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw()
     (vendor/symfony/http-kernel/HttpKernel.php:76)
  at Symfony\Component\HttpKernel\HttpKernel->handle()
     (vendor/symfony/http-kernel/Kernel.php:197)
  at Symfony\Component\HttpKernel\Kernel->handle()
     (vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php:35)
  at Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run()
     (vendor/autoload_runtime.php:29)
  at require_once('/usr/www/users/smartm/vendor/autoload_runtime.php')
     (public/index.php:5)