Exceptions
Exception
Error
in
src/Repository/UserRepository.php
(line 39)
public function findSupportStaffOrderById(): array{$users = $this->findAll();$staff = array_values(array_filter($users,static fn (User $u) => \in_array(SupportRoles::STAFF, $u->getRoles(), true)));usort($staff, static fn (User $a, User $b) => ($a->getId() ?? 0) <=> ($b->getId() ?? 0));return $staff;}
UserRepository::{closure:App\Repository\UserRepository::findSupportStaffOrderById():39}()
* @return list<User>*/public function findSupportStaffOrderById(): array{$users = $this->findAll();$staff = array_values(array_filter($users,static fn (User $u) => \in_array(SupportRoles::STAFF, $u->getRoles(), true)));usort($staff, static fn (User $a, User $b) => ($a->getId() ?? 0) <=> ($b->getId() ?? 0));
UserRepository->findSupportStaffOrderById()
in
src/Business/Support/TicketAssignmentService.php
(line 22)
) {}public function pickNextAssignee(): ?User{$staff = $this->userRepository->findSupportStaffOrderById();if ($staff === []) {return null;}$lastRaw = $this->appSettingRepository->getValue(AppSetting::KEY_LAST_ASSIGNEE_USER_ID);
TicketAssignmentService->pickNextAssignee()
in
src/Business/Support/SupportTicketService.php
(line 29)
$status = $this->ticketStatusRepository->findOneByCode(TicketStatus::CODE_NEW);if ($status === null) {throw new \RuntimeException('У базі немає статусу заявки з кодом NEW.');}$assignee = $this->ticketAssignmentService->pickNextAssignee();$ticket = new Ticket();$ticket->setClient($client);$ticket->setSubject($subject);$ticket->setBody($body);
SupportTicketService->createTicketFromBot()
in
src/Business/ClientCommands/CreateTicketFlowCommand.php
(line 173)
]);return;}$ticket = $this->supportTicketService->createTicketFromBot($client, $subject, $body);$client->resetBotConversation();$this->entityManager->flush();$assignee = $ticket->getAssignee();$assigneeLabel = $assignee !== null
CreateTicketFlowCommand->handleBody()
in
src/Business/ClientCommands/CreateTicketFlowCommand.php
(line 53)
return new TelegramResponse('CreateTicketFlow subject');}if ($state === Client::BOT_STATE_AWAITING_BODY) {$this->handleBody($request, $client);return new TelegramResponse('CreateTicketFlow body');}return new TelegramResponse('CreateTicketFlow noop');
/** @var CommandInterface $command */foreach ($this->routes as $command) {$isApplicable = $command->isApplicable($request);if ($isApplicable) {return $command->execute($request);}}return $this->defaultCommand->execute($request);}
/** @var array<string, mixed> $data */$data = (array) json_decode($request->getContent(), true);$tgRequest = (new TelegramRequest())->fromArray($data);/** @var TelegramResponse $response */$response = $supportBot->handle($tgRequest);return new JsonResponse($response->toArray());}}
in
vendor/symfony/http-kernel/HttpKernel.php
->
botAction
(line 183)
$this->dispatcher->dispatch($event, KernelEvents::CONTROLLER_ARGUMENTS);$controller = $event->getController();$arguments = $event->getArguments();// call controller$response = $controller(...$arguments);// viewif (!$response instanceof Response) {$event = new ViewEvent($this, $request, $type, $response, $event);$this->dispatcher->dispatch($event, KernelEvents::VIEW);
in
vendor/symfony/http-kernel/HttpKernel.php
->
handleRaw
(line 76)
$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;}
in
vendor/symfony/http-kernel/Kernel.php
->
handle
(line 193)
if (!$this->handlingHttpCache) {$this->resetServices = true;}try {return $this->getHttpKernel()->handle($request, $type, $catch);} finally {--$this->requestStackSize;}}
in
vendor/symfony/runtime/Runner/Symfony/HttpKernelRunner.php
->
handle
(line 35)
) {}public function run(): int{$response = $this->kernel->handle($this->request);if (Kernel::VERSION_ID >= 60400) {$response->send(false);if (\function_exists('fastcgi_finish_request') && !$this->debug) {
in
vendor/autoload_runtime.php
->
run
(line 32)
$app = $app(...$args);exit($runtime->getRunner($app)->run());
<?phpuse App\Kernel;require_once dirname(__DIR__).'/vendor/autoload_runtime.php';return function (array $context) {return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);};
Logs
| Level | Channel | Message |
|---|---|---|
| INFO 05:39:01 | request |
Matched route "_profiler". {
"route": "_profiler",
"route_parameters": {
"_route": "_profiler",
"_controller": "web_profiler.controller.profiler::panelAction",
"token": "9f611b"
},
"request_uri": "https://roma-bot.skylex.work/_profiler/9f611b?panel=exception&type=request",
"method": "GET"
}
|
Stack Trace
|
Error
|
|---|
Error:
Class "App\Security\SupportRoles" not found
at src/Repository/UserRepository.php:39
at App\Repository\UserRepository::{closure:App\Repository\UserRepository::findSupportStaffOrderById():39}()
at array_filter()
(src/Repository/UserRepository.php:37)
at App\Repository\UserRepository->findSupportStaffOrderById()
(src/Business/Support/TicketAssignmentService.php:22)
at App\Business\Support\TicketAssignmentService->pickNextAssignee()
(src/Business/Support/SupportTicketService.php:29)
at App\Business\Support\SupportTicketService->createTicketFromBot()
(src/Business/ClientCommands/CreateTicketFlowCommand.php:173)
at App\Business\ClientCommands\CreateTicketFlowCommand->handleBody()
(src/Business/ClientCommands/CreateTicketFlowCommand.php:53)
at App\Business\ClientCommands\CreateTicketFlowCommand->execute()
(src/Business/Bot/BotHandler.php:42)
at App\Business\Bot\BotHandler->handle()
(src/Controller/SupportBotController.php:28)
at App\Controller\SupportBotController->botAction()
(vendor/symfony/http-kernel/HttpKernel.php:183)
at Symfony\Component\HttpKernel\HttpKernel->handleRaw()
(vendor/symfony/http-kernel/HttpKernel.php:76)
at Symfony\Component\HttpKernel\HttpKernel->handle()
(vendor/symfony/http-kernel/Kernel.php:193)
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:32)
at require_once('/var/www/roma/releases/4/vendor/autoload_runtime.php')
(public/index.php:5)
|