{
$response = $this->apiClient->request("GET", $url, $headers, $body, $noAuth);
if($response['status']){
return $response["content"];
}else{
$this->session->getFlashBag()->add("error", $response["content"]);
return false;
}
}
/**
* @param $id
* @return mixed
*/
public function get($id)
{
return $this->getRequest("{$this->apiRoute}/{$id}");
}
/**
* @param $param
* @return mixed|\Symfony\Component\HttpFoundation\RedirectResponse
$userData = $usersService->getByFilters("userUuid=$id");
$id = $userData['hydra:member'][0]['id'];
}
$users = $this->getUser();
$user = $usersService->get($id);
$Lifestyle = false;
if(!empty($user['foods']) || !empty($user['musics']) || !empty($user['hobbies']) || !empty($user['iEat']) || !empty($user['drinking']) || !empty($user['healthyLifestyle']) )
{
$Lifestyle = true;
}
$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);
{
$request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
$this->requestStack->push($request);
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;
}
}
Request::setTrustedHosts([$trustedHosts]);
}
$kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);
No log messages
Error
|
---|
Error: Call to a member function getFlashBag() on null at src/Services/BaseService.php:185 at App\Services\BaseService->getRequest() (src/Services/BaseService.php:132) at App\Services\BaseService->get() (src/Controller/ProfileController.php:194) at App\Controller\ProfileController->userHostProfile() (vendor/symfony/http-kernel/HttpKernel.php:163) 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:29) |