$aroma = $this->wineFlavorRepository->findOneBy(array('slug' . $lang => $aromaPath));
$country = (!empty($countryPath)) ? $this->countryRepository->findOneBy(array('slug' . $lang2 => $countryPath)) : NULL;
$region = (!empty($regionPath)) ? $this->regionRepository->findOneBy(array('slug' . $lang2 => $regionPath)) : NULL;
$body['metas']['url'] = array();
foreach ($langs as $lang) {
$body['metas']['url'][$lang] = 'https://' . $_ENV['PROJECT_VNK_DOMAIN_' . strtoupper($lang)] . $this->translator->trans('path_top_aroma', array(), 'winedexer', $lang) . '/' . $aroma->getSlug($lang) . (!empty($region) ? '/' . $region->getPath($lang) : ((!empty($country) ? '/' . $country->getSlug($lang) : '')));
}
}
if (empty($body) || empty($body['body'])) {
try {
$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);
$this->dispatcher->dispatch($event, KernelEvents::VIEW);
public function handle(Request $request, int $type = HttpKernelInterface::MAIN_REQUEST, bool $catch = true)
{
$request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
try {
return $this->handleRaw($request, $type);
} catch (\Exception $e) {
if ($e instanceof RequestExceptionInterface) {
$e = new BadRequestHttpException($e->getMessage(), $e);
}
if (false === $catch) {
$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()
);
<?php
use App\Kernel;
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
Error
|
---|
Error: Call to a member function getSlug() on null at src/Controller/Vinotek/TopAromaController.php:299 at App\Controller\Vinotek\TopAromaController->topAromaCountryAction() (vendor/symfony/http-kernel/HttpKernel.php:156) at Symfony\Component\HttpKernel\HttpKernel->handleRaw() (vendor/symfony/http-kernel/HttpKernel.php:78) at Symfony\Component\HttpKernel\HttpKernel->handle() (vendor/symfony/http-kernel/Kernel.php:199) at Symfony\Component\HttpKernel\Kernel->handle() (vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php:37) at Symfony\Component\Runtime\Runner\Symfony\HttpKernelRunner->run() (vendor/autoload_runtime.php:35) at require_once('/var/www/winemakers/wine-makers-core/vendor/autoload_runtime.php') (public/index.php:5) |