Symfony Exception

TypeError

HTTP 500 Internal Server Error

Binova\CmsBundle\Controller\DefaultController::__construct(): Argument #5 ($searchBar) must be of type Binova\SharedBundle\Service\SearchBar, Binova\SharedBundle\Service\SearchBar\SearchBar given, called in /var/www/html/binova/var/cache/prod/ContainerPrOFtNS/getBinovaCms_DefaultControllerService.php on line 24

Exception

TypeError

  1. use Symfony\Component\Security\Core\Role\RoleHierarchyInterface;
  2. use Symfony\Contracts\Translation\TranslatorInterface;
  3. class DefaultController extends BaseDefaultController
  4. {
  5.     public function __construct(SharedConfig $sharedConfig,
  6.                                 ObjectDefFactory $objectDefFactory,
  7.                                 UploadPathsService $uploadPaths,
  8.                                 ParamUserService $paramUser,
  9.                                 SearchBar $searchBar,
  10.                                 TranslatorInterface $translator,
  1.     {
  2.         include_once \dirname(__DIR__4).'/vendor/symfony/framework-bundle/Controller/AbstractController.php';
  3.         include_once \dirname(__DIR__4).'/vendor/binova/shared-bundle/src/Controller/Base/BaseDefaultController.php';
  4.         include_once \dirname(__DIR__4).'/vendor/binova/cms-bundle/src/Controller/DefaultController.php';
  5.         $container->services['binova_cms.default_controller'] = $instance = new \Binova\CmsBundle\Controller\DefaultController(($container->services['binova_shared.config'] ?? $container->load('getBinovaShared_ConfigService')), ($container->services['binova_shared.object_def'] ?? $container->load('getBinovaShared_ObjectDefService')), ($container->services['binova_shared.upload_paths'] ?? $container->load('getBinovaShared_UploadPathsService')), ($container->services['binova_shared.param_user'] ?? $container->load('getBinovaShared_ParamUserService')), ($container->services['binova_shared.searchbar'] ?? $container->load('getBinovaShared_SearchbarService')), ($container->services['translator'] ?? $container->load('getTranslatorService')), ($container->services['doctrine.orm.default_entity_manager'] ?? $container->load('getDoctrine_Orm_DefaultEntityManagerService')), ($container->services['.container.private.session'] ?? $container->load('get_Container_Private_SessionService')), ($container->services['binova_shared.security.query_constraint_adder'] ?? $container->load('getBinovaShared_Security_QueryConstraintAdderService')), ($container->services['knp_paginator'] ?? $container->load('getKnpPaginatorService')), ($container->services['event_dispatcher'] ?? $container->getEventDispatcherService()), ($container->privates['binova_shared.service.controller_service'] ?? $container->load('getBinovaShared_Service_ControllerServiceService')), ($container->privates['security.role_hierarchy'] ?? $container->load('getSecurity_RoleHierarchyService')), ($container->services['.container.private.security.authorization_checker'] ?? $container->load('get_Container_Private_Security_AuthorizationCheckerService')), ($container->services['router'] ?? $container->getRouterService()));
  6.         $instance->setContainer(($container->privates['.service_locator.mx0UMmY'] ?? $container->load('get_ServiceLocator_Mx0UMmYService'))->withContext('binova_cms.default_controller'$container));
  7.         return $instance;
  8.     }
  1.             $file .= '.php';
  2.         }
  3.         $service = require $this->containerDir.\DIRECTORY_SEPARATOR.$file;
  4.         return class_exists($classfalse) ? $class::do($this$lazyLoad) : $service;
  5.     }
  6.     protected function createProxy($class\Closure $factory)
  7.     {
  8.         class_exists($classfalse) || require __DIR__.'/'.$class.'.php';
  1.         $this->loading[$id] = true;
  2.         try {
  3.             if (isset($this->fileMap[$id])) {
  4.                 return /* self::IGNORE_ON_UNINITIALIZED_REFERENCE */ === $invalidBehavior null $this->load($this->fileMap[$id]);
  5.             } elseif (isset($this->methodMap[$id])) {
  6.                 return /* self::IGNORE_ON_UNINITIALIZED_REFERENCE */ === $invalidBehavior null $this->{$this->methodMap[$id]}();
  7.             }
  8.         } catch (\Exception $e) {
  9.             unset($this->services[$id]);
  1.      */
  2.     public function get(string $idint $invalidBehavior /* self::EXCEPTION_ON_INVALID_REFERENCE */ 1)
  3.     {
  4.         return $this->services[$id]
  5.             ?? $this->services[$id $this->aliases[$id] ?? $id]
  6.             ?? ('service_container' === $id $this : ($this->factories[$id] ?? [$this'make'])($id$invalidBehavior));
  7.     }
  8.     /**
  9.      * Creates a service.
  10.      *
  1.     protected function instantiateController(string $class)
  2.     {
  3.         $class ltrim($class'\\');
  4.         if ($this->container->has($class)) {
  5.             return $this->container->get($class);
  6.         }
  7.         try {
  8.             return parent::instantiateController($class);
  9.         } catch (\Error $e) {
  1.     /**
  2.      * {@inheritdoc}
  3.      */
  4.     protected function instantiateController(string $class): object
  5.     {
  6.         $controller parent::instantiateController($class);
  7.         if ($controller instanceof ContainerAwareInterface) {
  8.             $controller->setContainer($this->container);
  9.         }
  10.         if ($controller instanceof AbstractController) {
  1.         }
  2.         [$class$method] = explode('::'$controller2);
  3.         try {
  4.             $controller = [$this->instantiateController($class), $method];
  5.         } catch (\Error|\LogicException $e) {
  6.             try {
  7.                 if ((new \ReflectionMethod($class$method))->isStatic()) {
  8.                     return $class.'::'.$method;
  9.                 }
  1.         if (=== substr_count($controller':')) {
  2.             $controller str_replace(':''::'$controller);
  3.             trigger_deprecation('symfony/http-kernel''5.1''Referencing controllers with a single colon is deprecated. Use "%s" instead.'$controller);
  4.         }
  5.         return parent::createController($controller);
  6.     }
  7.     /**
  8.      * {@inheritdoc}
  9.      */
  1.         if (\function_exists($controller)) {
  2.             return $controller;
  3.         }
  4.         try {
  5.             $callable $this->createController($controller);
  6.         } catch (\InvalidArgumentException $e) {
  7.             throw new \InvalidArgumentException(sprintf('The controller for URI "%s" is not callable: '$request->getPathInfo()).$e->getMessage(), 0$e);
  8.         }
  9.         if (!\is_callable($callable)) {
  1.     public function getController(Request $request)
  2.     {
  3.         $e $this->stopwatch->start('controller.get_callable');
  4.         try {
  5.             return $this->resolver->getController($request);
  6.         } finally {
  7.             $e->stop();
  8.         }
  9.     }
  10. }
in vendor/symfony/http-kernel/HttpKernel.php -> getController (line 146)
  1.         if ($event->hasResponse()) {
  2.             return $this->filterResponse($event->getResponse(), $request$type);
  3.         }
  4.         // load controller
  5.         if (false === $controller $this->resolver->getController($request)) {
  6.             throw new NotFoundHttpException(sprintf('Unable to find the controller for path "%s". The route is wrongly configured.'$request->getPathInfo()));
  7.         }
  8.         $event = new ControllerEvent($this$controller$request$type);
  9.         $this->dispatcher->dispatch($eventKernelEvents::CONTROLLER);
  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.     }
Kernel->handle() in public/index.php (line 20)
  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);

Logs

No log messages

Stack Trace

TypeError
TypeError:
Binova\CmsBundle\Controller\DefaultController::__construct(): Argument #5 ($searchBar) must be of type Binova\SharedBundle\Service\SearchBar, Binova\SharedBundle\Service\SearchBar\SearchBar given, called in /var/www/html/binova/var/cache/prod/ContainerPrOFtNS/getBinovaCms_DefaultControllerService.php on line 24

  at vendor/binova/cms-bundle/src/Controller/DefaultController.php:37
  at Binova\CmsBundle\Controller\DefaultController->__construct()
     (var/cache/prod/ContainerPrOFtNS/getBinovaCms_DefaultControllerService.php:24)
  at ContainerPrOFtNS\getBinovaCms_DefaultControllerService::do()
     (var/cache/prod/ContainerPrOFtNS/App_KernelProdDebugContainer.php:499)
  at ContainerPrOFtNS\App_KernelProdDebugContainer->load()
     (vendor/symfony/dependency-injection/Container.php:238)
  at Symfony\Component\DependencyInjection\Container->make()
     (vendor/symfony/dependency-injection/Container.php:220)
  at Symfony\Component\DependencyInjection\Container->get()
     (vendor/symfony/http-kernel/Controller/ContainerControllerResolver.php:53)
  at Symfony\Component\HttpKernel\Controller\ContainerControllerResolver->instantiateController()
     (vendor/symfony/framework-bundle/Controller/ControllerResolver.php:29)
  at Symfony\Bundle\FrameworkBundle\Controller\ControllerResolver->instantiateController()
     (vendor/symfony/http-kernel/Controller/ControllerResolver.php:120)
  at Symfony\Component\HttpKernel\Controller\ControllerResolver->createController()
     (vendor/symfony/http-kernel/Controller/ContainerControllerResolver.php:42)
  at Symfony\Component\HttpKernel\Controller\ContainerControllerResolver->createController()
     (vendor/symfony/http-kernel/Controller/ControllerResolver.php:86)
  at Symfony\Component\HttpKernel\Controller\ControllerResolver->getController()
     (vendor/symfony/http-kernel/Controller/TraceableControllerResolver.php:39)
  at Symfony\Component\HttpKernel\Controller\TraceableControllerResolver->getController()
     (vendor/symfony/http-kernel/HttpKernel.php:146)
  at Symfony\Component\HttpKernel\HttpKernel->handleRaw()
     (vendor/symfony/http-kernel/HttpKernel.php:75)
  at Symfony\Component\HttpKernel\HttpKernel->handle()
     (vendor/symfony/http-kernel/Kernel.php:202)
  at Symfony\Component\HttpKernel\Kernel->handle()
     (public/index.php:20)