* @return AnimalPoll
*/
public function preparePollEntity($animalId, $animalPollToken = null)
{
$animalPoll = null;
$user = $this->tokenStorage->getToken()->getUser();
if (!$user instanceof User) {
$user = null;
}
}
#[Route('/{id}/ankieta/{animalPollToken}/{step}')]
public function pollAction(Request $request, AdoptionPollService $adoptionPollService, $id, $animalPollToken = 0, $step = 0)
{
$animalPoll = $adoptionPollService->preparePollEntity($id, $animalPollToken);
$returnForm = $adoptionPollService->prepareForm($animalPoll);
//synchronize steps if necessary
if (!$request->isMethod('POST') && $step != $animalPoll->getCurrentStep()) {
return $this->redirectToRoute(
$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);
try {
return $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()
);
<?php
use App\Kernel;
use Symfony\Component\HttpFoundation\Request;
require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
return function (array $context) {
$request = Request::createFromGlobals();
if($request->getClientIp() == "95.217.17.2") {
No log messages
Error
|
---|
Error: Call to a member function getUser() on null at src/Service/AdoptionPollService.php:168 at App\Service\AdoptionPollService->preparePollEntity() (src/Controller/Front/AnimalController.php:292) at App\Controller\Front\AnimalController->pollAction() (vendor/symfony/http-kernel/HttpKernel.php:163) at Symfony\Component\HttpKernel\HttpKernel->handleRaw() (vendor/symfony/http-kernel/HttpKernel.php:74) at Symfony\Component\HttpKernel\HttpKernel->handle() (vendor/symfony/http-kernel/Kernel.php:184) 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('/home/adopt/web/adopciaki.pl/public_html/vendor/autoload_runtime.php') (public/index.php:6) |