array_merge($data, $this->settings)
);
}
#[Route('/catalog/{cid}/{page}', name: 'catalog_category')]
public function category(EntityManagerInterface $entityManager, int $cid, int $page = 1): Response
{
$productRepo = $entityManager->getRepository(Product::class);
$productStockRepo = $entityManager->getRepository(ProductStock::class);
$productTotal = $productRepo->findBy(['categoryId'=>$cid]);
$this->dispatcher->dispatch($event, KernelEvents::CONTROLLER_ARGUMENTS);
$controller = $event->getController();
$arguments = $event->getArguments();
// call controller
$response = $controller(...$arguments);
// view
if (!$response instanceof Response) {
$event = new ViewEvent($this, $request, $type, $response, $event);
$this->dispatcher->dispatch($event, KernelEvents::VIEW);
$request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
$this->requestStack->push($request);
$response = null;
try {
return $response = $this->handleRaw($request, $type);
} catch (\Throwable $e) {
if ($e instanceof \Error && !$this->handleAllThrowables) {
throw $e;
}
$this->boot();
++$this->requestStackSize;
$this->resetServices = true;
try {
return $this->getHttpKernel()->handle($request, $type, $catch);
} finally {
--$this->requestStackSize;
}
}
$this->request = $request;
}
public function run(): int
{
$response = $this->kernel->handle($this->request);
$response->send();
if ($this->kernel instanceof TerminableInterface) {
$this->kernel->terminate($this->request, $response);
}
$app = $app(...$args);
exit(
$runtime
->getRunner($app)
->run()
);
if($_SERVER['REQUEST_URI'] == '//'){
header("location: /");
exit();
}
require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
return function (array $context) {
return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
};
No log messages
TypeError
|
---|
TypeError: App\Controller\catalog\CatalogMainController::category(): Argument #2 ($cid) must be of type int, string given, called in /var/www/vhosts/u0383635.plsk.regruhosting.ru/httpdocs/n.garage15.ru/vendor/symfony/http-kernel/HttpKernel.php on line 182 at src/Controller/catalog/CatalogMainController.php:31 at App\Controller\catalog\CatalogMainController->category(object(EntityManagerGhostEbeb667), 'product', 1) (vendor/symfony/http-kernel/HttpKernel.php:182) at Symfony\Component\HttpKernel\HttpKernel->handleRaw(object(Request), 1) (vendor/symfony/http-kernel/HttpKernel.php:76) at Symfony\Component\HttpKernel\HttpKernel->handle(object(Request), 1, true) (vendor/symfony/http-kernel/Kernel.php:197) at Symfony\Component\HttpKernel\Kernel->handle(object(Request)) (vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php:35) at Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run() (vendor/autoload_runtime.php:29) at require_once('/var/www/vhosts/u0383635.plsk.regruhosting.ru/httpdocs/n.garage15.ru/vendor/autoload_runtime.php') (public/index.php:13) |