vendor/symfony/http-kernel/HttpKernel.php line 97

Open in your IDE?
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <[email protected]>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\HttpKernel;
  11. use Symfony\Component\HttpFoundation\Exception\RequestExceptionInterface;
  12. use Symfony\Component\HttpFoundation\Request;
  13. use Symfony\Component\HttpFoundation\RequestStack;
  14. use Symfony\Component\HttpFoundation\Response;
  15. use Symfony\Component\HttpKernel\Controller\ArgumentResolver;
  16. use Symfony\Component\HttpKernel\Controller\ArgumentResolverInterface;
  17. use Symfony\Component\HttpKernel\Controller\ControllerResolverInterface;
  18. use Symfony\Component\HttpKernel\Event\ControllerArgumentsEvent;
  19. use Symfony\Component\HttpKernel\Event\ControllerEvent;
  20. use Symfony\Component\HttpKernel\Event\ExceptionEvent;
  21. use Symfony\Component\HttpKernel\Event\FinishRequestEvent;
  22. use Symfony\Component\HttpKernel\Event\RequestEvent;
  23. use Symfony\Component\HttpKernel\Event\ResponseEvent;
  24. use Symfony\Component\HttpKernel\Event\TerminateEvent;
  25. use Symfony\Component\HttpKernel\Event\ViewEvent;
  26. use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
  27. use Symfony\Component\HttpKernel\Exception\ControllerDoesNotReturnResponseException;
  28. use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
  29. use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
  30. use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
  31. // Help opcache.preload discover always-needed symbols
  32. class_exists(ControllerArgumentsEvent::class);
  33. class_exists(ControllerEvent::class);
  34. class_exists(ExceptionEvent::class);
  35. class_exists(FinishRequestEvent::class);
  36. class_exists(RequestEvent::class);
  37. class_exists(ResponseEvent::class);
  38. class_exists(TerminateEvent::class);
  39. class_exists(ViewEvent::class);
  40. class_exists(KernelEvents::class);
  41. /**
  42. * HttpKernel notifies events to convert a Request object to a Response one.
  43. *
  44. * @author Fabien Potencier <[email protected]>
  45. */
  46. class HttpKernel implements HttpKernelInterface, TerminableInterface
  47. {
  48. protected $dispatcher;
  49. protected $resolver;
  50. protected $requestStack;
  51. private $argumentResolver;
  52. public function __construct(EventDispatcherInterface $dispatcher, ControllerResolverInterface $resolver, ?RequestStack $requestStack = null, ?ArgumentResolverInterface $argumentResolver = null)
  53. {
  54. $this->dispatcher = $dispatcher;
  55. $this->resolver = $resolver;
  56. $this->requestStack = $requestStack ?? new RequestStack();
  57. $this->argumentResolver = $argumentResolver ?? new ArgumentResolver();
  58. }
  59. /**
  60. * {@inheritdoc}
  61. */
  62. public function handle(Request $request, int $type = HttpKernelInterface::MAIN_REQUEST, bool $catch = true)
  63. {
  64. $request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
  65. $this->requestStack->push($request);
  66. try {
  67. return $this->handleRaw($request, $type);
  68. } catch (\Exception $e) {
  69. if ($e instanceof RequestExceptionInterface) {
  70. $e = new BadRequestHttpException($e->getMessage(), $e);
  71. }
  72. if (false === $catch) {
  73. $this->finishRequest($request, $type);
  74. throw $e;
  75. }
  76. return $this->handleThrowable($e, $request, $type);
  77. } finally {
  78. $this->requestStack->pop();
  79. }
  80. }
  81. /**
  82. * {@inheritdoc}
  83. */
  84. public function terminate(Request $request, Response $response)
  85. {
  86. $this->dispatcher->dispatch(new TerminateEvent($this, $request, $response), KernelEvents::TERMINATE);
  87. }
  88. /**
  89. * @internal
  90. */
  91. public function terminateWithException(\Throwable $exception, ?Request $request = null)
  92. {
  93. if (!$request = $request ?: $this->requestStack->getMainRequest()) {
  94. throw $exception;
  95. }
  96. if ($pop = $request !== $this->requestStack->getMainRequest()) {
  97. $this->requestStack->push($request);
  98. }
  99. try {
  100. $response = $this->handleThrowable($exception, $request, self::MAIN_REQUEST);
  101. } finally {
  102. if ($pop) {
  103. $this->requestStack->pop();
  104. }
  105. }
  106. $response->sendHeaders();
  107. $response->sendContent();
  108. $this->terminate($request, $response);
  109. }
  110. /**
  111. * Handles a request to convert it to a response.
  112. *
  113. * Exceptions are not caught.
  114. *
  115. * @throws \LogicException If one of the listener does not behave as expected
  116. * @throws NotFoundHttpException When controller cannot be found
  117. */
  118. private function handleRaw(Request $request, int $type = self::MAIN_REQUEST): Response
  119. {
  120. // request
  121. $event = new RequestEvent($this, $request, $type);
  122. $this->dispatcher->dispatch($event, KernelEvents::REQUEST);
  123. if ($event->hasResponse()) {
  124. return $this->filterResponse($event->getResponse(), $request, $type);
  125. }
  126. // load controller
  127. if (false === $controller = $this->resolver->getController($request)) {
  128. throw new NotFoundHttpException(sprintf('Unable to find the controller for path "%s". The route is wrongly configured.', $request->getPathInfo()));
  129. }
  130. $event = new ControllerEvent($this, $controller, $request, $type);
  131. $this->dispatcher->dispatch($event, KernelEvents::CONTROLLER);
  132. $controller = $event->getController();
  133. // controller arguments
  134. $arguments = $this->argumentResolver->getArguments($request, $controller);
  135. $event = new ControllerArgumentsEvent($this, $controller, $arguments, $request, $type);
  136. $this->dispatcher->dispatch($event, KernelEvents::CONTROLLER_ARGUMENTS);
  137. $controller = $event->getController();
  138. $arguments = $event->getArguments();
  139. // call controller
  140. $response = $controller(...$arguments);
  141. // view
  142. if (!$response instanceof Response) {
  143. $event = new ViewEvent($this, $request, $type, $response);
  144. $this->dispatcher->dispatch($event, KernelEvents::VIEW);
  145. if ($event->hasResponse()) {
  146. $response = $event->getResponse();
  147. } else {
  148. $msg = sprintf('The controller must return a "Symfony\Component\HttpFoundation\Response" object but it returned %s.', $this->varToString($response));
  149. // the user may have forgotten to return something
  150. if (null === $response) {
  151. $msg .= ' Did you forget to add a return statement somewhere in your controller?';
  152. }
  153. throw new ControllerDoesNotReturnResponseException($msg, $controller, __FILE__, __LINE__ - 17);
  154. }
  155. }
  156. return $this->filterResponse($response, $request, $type);
  157. }
  158. /**
  159. * Filters a response object.
  160. *
  161. * @throws \RuntimeException if the passed object is not a Response instance
  162. */
  163. private function filterResponse(Response $response, Request $request, int $type): Response
  164. {
  165. $event = new ResponseEvent($this, $request, $type, $response);
  166. $this->dispatcher->dispatch($event, KernelEvents::RESPONSE);
  167. $this->finishRequest($request, $type);
  168. return $event->getResponse();
  169. }
  170. /**
  171. * Publishes the finish request event, then pop the request from the stack.
  172. *
  173. * Note that the order of the operations is important here, otherwise
  174. * operations such as {@link RequestStack::getParentRequest()} can lead to
  175. * weird results.
  176. */
  177. private function finishRequest(Request $request, int $type)
  178. {
  179. $this->dispatcher->dispatch(new FinishRequestEvent($this, $request, $type), KernelEvents::FINISH_REQUEST);
  180. }
  181. /**
  182. * Handles a throwable by trying to convert it to a Response.
  183. *
  184. * @throws \Exception
  185. */
  186. private function handleThrowable(\Throwable $e, Request $request, int $type): Response
  187. {
  188. $event = new ExceptionEvent($this, $request, $type, $e);
  189. $this->dispatcher->dispatch($event, KernelEvents::EXCEPTION);
  190. // a listener might have replaced the exception
  191. $e = $event->getThrowable();
  192. if (!$event->hasResponse()) {
  193. $this->finishRequest($request, $type);
  194. throw $e;
  195. }
  196. $response = $event->getResponse();
  197. // the developer asked for a specific status code
  198. if (!$event->isAllowingCustomResponseCode() && !$response->isClientError() && !$response->isServerError() && !$response->isRedirect()) {
  199. // ensure that we actually have an error response
  200. if ($e instanceof HttpExceptionInterface) {
  201. // keep the HTTP status code and headers
  202. $response->setStatusCode($e->getStatusCode());
  203. $response->headers->add($e->getHeaders());
  204. } else {
  205. $response->setStatusCode(500);
  206. }
  207. }
  208. try {
  209. return $this->filterResponse($response, $request, $type);
  210. } catch (\Exception $e) {
  211. return $response;
  212. }
  213. }
  214. /**
  215. * Returns a human-readable string for the specified variable.
  216. */
  217. private function varToString($var): string
  218. {
  219. if (\is_object($var)) {
  220. return sprintf('an object of type %s', \get_class($var));
  221. }
  222. if (\is_array($var)) {
  223. $a = [];
  224. foreach ($var as $k => $v) {
  225. $a[] = sprintf('%s => ...', $k);
  226. }
  227. return sprintf('an array ([%s])', mb_substr(implode(', ', $a), 0, 255));
  228. }
  229. if (\is_resource($var)) {
  230. return sprintf('a resource (%s)', get_resource_type($var));
  231. }
  232. if (null === $var) {
  233. return 'null';
  234. }
  235. if (false === $var) {
  236. return 'a boolean value (false)';
  237. }
  238. if (true === $var) {
  239. return 'a boolean value (true)';
  240. }
  241. if (\is_string($var)) {
  242. return sprintf('a string ("%s%s")', mb_substr($var, 0, 255), mb_strlen($var) > 255 ? '...' : '');
  243. }
  244. if (is_numeric($var)) {
  245. return sprintf('a number (%s)', (string) $var);
  246. }
  247. return (string) $var;
  248. }
  249. }
Attempted to call function "bcadd" from namespace "App\Services\Fx". (500 Internal Server Error)

Symfony Exception

UndefinedFunctionError

HTTP 500 Internal Server Error

Attempted to call function "bcadd" from namespace "App\Services\Fx".

Exception

Symfony\Component\ErrorHandler\Error\ UndefinedFunctionError

  1.     {
  2.         $raw trim((string) $value);
  3.         if ($raw === '' || !is_numeric($raw) || stripos($raw'e') !== false) {
  4.             throw new \InvalidArgumentException(sprintf('Invalid FX safety buffer percent: "%s"'$raw));
  5.         }
  6.         $normalized bcadd($raw'0'4);
  7.         if (bccomp($normalized'0'4) < || bccomp($normalized'50'4) > 0) {
  8.             throw new \InvalidArgumentException('FX safety buffer percent must be between 0 and 50');
  9.         }
  10.         return $normalized;
FxSafetyBufferPolicy->normalizePercent() in src/Services/Fx/FxSafetyBufferPolicy.php (line 28)
  1.     /**
  2.      * @param int|float|string $bufferPercent Percent points, e.g. 5 for 5%.
  3.      */
  4.     public function __construct($bufferPercent 5, ?EntityManagerInterface $entityManager null)
  5.     {
  6.         $this->defaultPercent $this->normalizePercent($bufferPercent);
  7.         $this->entityManager $entityManager;
  8.     }
  9.     public function getPolicyName(): string
  10.     {
  1.         if (isset($this->services['App\\Services\\Fx\\FxSafetyBufferPolicy'])) {
  2.             return $this->services['App\\Services\\Fx\\FxSafetyBufferPolicy'];
  3.         }
  4.         return $this->services['App\\Services\\Fx\\FxSafetyBufferPolicy'] = new \App\Services\Fx\FxSafetyBufferPolicy($this->getEnv('int:FX_SAFETY_BUFFER_PERCENT'), $a);
  5.     }
  6.     /**
  7.      * Gets the public 'App\Services\Fx\FxService' shared autowired service.
  8.      *
in var/cache/dev/ContainerSxeEifr/App_KernelDevDebugContainer.php -> getFxSafetyBufferPolicyService (line 10698)
  1.         $b = ($this->services['App\\Services\\Fx\\DatabaseFxRateProvider'] ?? $this->getDatabaseFxRateProviderService());
  2.         if (isset($this->services['App\\Services\\Fx\\FxService'])) {
  3.             return $this->services['App\\Services\\Fx\\FxService'];
  4.         }
  5.         $c = ($this->services['App\\Services\\Fx\\FxSafetyBufferPolicy'] ?? $this->getFxSafetyBufferPolicyService());
  6.         if (isset($this->services['App\\Services\\Fx\\FxService'])) {
  7.             return $this->services['App\\Services\\Fx\\FxService'];
  8.         }
  1.      */
  2.     protected function getPaymentFxServiceService()
  3.     {
  4.         include_once \dirname(__DIR__4).'/src/Services/Currency/PaymentFxService.php';
  5.         $a = ($this->services['App\\Services\\Fx\\FxService'] ?? $this->getFxServiceService());
  6.         if (isset($this->services['App\\Services\\Currency\\PaymentFxService'])) {
  7.             return $this->services['App\\Services\\Currency\\PaymentFxService'];
  8.         }
  9.         $b = ($this->services['App\\Services\\Currency\\LedgerCurrencyService'] ?? $this->getLedgerCurrencyServiceService());
in var/cache/dev/ContainerSxeEifr/App_KernelDevDebugContainer.php -> getPaymentFxServiceService (line 11449)
  1.         $a = ($this->services['doctrine.orm.default_entity_manager'] ?? $this->getDoctrine_Orm_DefaultEntityManagerService());
  2.         if (isset($this->services['App\\Services\\Integration\\Payadmit\\PayadmitIntegrationService'])) {
  3.             return $this->services['App\\Services\\Integration\\Payadmit\\PayadmitIntegrationService'];
  4.         }
  5.         $b = ($this->services['App\\Services\\Currency\\PaymentFxService'] ?? $this->getPaymentFxServiceService());
  6.         if (isset($this->services['App\\Services\\Integration\\Payadmit\\PayadmitIntegrationService'])) {
  7.             return $this->services['App\\Services\\Integration\\Payadmit\\PayadmitIntegrationService'];
  8.         }
  9.         $c = ($this->services['App\\Services\\Currency\\LedgerCurrencyService'] ?? $this->getLedgerCurrencyServiceService());
in var/cache/dev/ContainerSxeEifr/App_KernelDevDebugContainer.php -> getPayadmitIntegrationServiceService (line 7232)
  1.     protected function getPayadmitWebhookTerminateSubscriberService()
  2.     {
  3.         include_once \dirname(__DIR__4).'/src/EventSubscriber/PayadmitWebhookTerminateSubscriber.php';
  4.         include_once \dirname(__DIR__4).'/src/Services/Integration/Payadmit/PayadmitAsyncWebhookBuffer.php';
  5.         $a = ($this->services['App\\Services\\Integration\\Payadmit\\PayadmitIntegrationService'] ?? $this->getPayadmitIntegrationServiceService());
  6.         if (isset($this->services['App\\EventSubscriber\\PayadmitWebhookTerminateSubscriber'])) {
  7.             return $this->services['App\\EventSubscriber\\PayadmitWebhookTerminateSubscriber'];
  8.         }
in var/cache/dev/ContainerSxeEifr/App_KernelDevDebugContainer.php -> getPayadmitWebhookTerminateSubscriberService (line 15422)
  1.         }, => 'onKernelRequest'], 5);
  2.         $instance->addListener('Symfony\\Component\\Security\\Http\\Event\\LogoutEvent', [=> function () {
  3.             return ($this->services['App\\EventSubscriber\\LogoutSubscriber'] ?? $this->getLogoutSubscriberService());
  4.         }, => 'onLogoutEvent'], 0);
  5.         $instance->addListener('kernel.terminate', [=> function () {
  6.             return ($this->services['App\\EventSubscriber\\PayadmitWebhookTerminateSubscriber'] ?? $this->getPayadmitWebhookTerminateSubscriberService());
  7.         }, => 'onKernelTerminate'], 0);
  8.         $instance->addListener('kernel.response', [=> function () {
  9.             return ($this->services['App\\EventSubscriber\\SessionCookieDedupSubscriber'] ?? ($this->services['App\\EventSubscriber\\SessionCookieDedupSubscriber'] = new \App\EventSubscriber\SessionCookieDedupSubscriber()));
  10.         }, => 'onKernelResponse'], -1010);
  11.         $instance->addListener('kernel.request', [=> function () {
in vendor/symfony/event-dispatcher/EventDispatcher.php -> ContainerSxeEifr\{closure} (line 245)
  1.         $this->sorted[$eventName] = [];
  2.         foreach ($this->listeners[$eventName] as &$listeners) {
  3.             foreach ($listeners as $k => &$listener) {
  4.                 if (\is_array($listener) && isset($listener[0]) && $listener[0] instanceof \Closure && >= \count($listener)) {
  5.                     $listener[0] = $listener[0]();
  6.                     $listener[1] = $listener[1] ?? '__invoke';
  7.                 }
  8.                 $this->sorted[$eventName][] = $listener;
  9.             }
  10.         }
  1.             if (empty($this->listeners[$eventName])) {
  2.                 return [];
  3.             }
  4.             if (!isset($this->sorted[$eventName])) {
  5.                 $this->sortListeners($eventName);
  6.             }
  7.             return $this->sorted[$eventName];
  8.         }
  1.             $this->orphanedEvents[$this->currentRequestHash][] = $eventName;
  2.             return;
  3.         }
  4.         foreach ($this->dispatcher->getListeners($eventName) as $listener) {
  5.             $priority $this->getListenerPriority($eventName$listener);
  6.             $wrappedListener = new WrappedListener($listener instanceof WrappedListener $listener->getWrappedListener() : $listenernull$this->stopwatch$this);
  7.             $this->wrappedListeners[$eventName][] = $wrappedListener;
  8.             $this->dispatcher->removeListener($eventName$listener);
  9.             $this->dispatcher->addListener($eventName$wrappedListener$priority);
  1.         if (null !== $this->logger && $event instanceof StoppableEventInterface && $event->isPropagationStopped()) {
  2.             $this->logger->debug(sprintf('The "%s" event is already stopped. No listeners have been called.'$eventName));
  3.         }
  4.         $this->preProcess($eventName);
  5.         try {
  6.             $this->beforeDispatch($eventName$event);
  7.             try {
  8.                 $e $this->stopwatch->start($eventName'section');
  9.                 try {
  1.     /**
  2.      * {@inheritdoc}
  3.      */
  4.     public function terminate(Request $requestResponse $response)
  5.     {
  6.         $this->dispatcher->dispatch(new TerminateEvent($this$request$response), KernelEvents::TERMINATE);
  7.     }
  8.     /**
  9.      * @internal
  10.      */
in vendor/symfony/http-kernel/Kernel.php -> terminate (line 159)
  1.         if (false === $this->booted) {
  2.             return;
  3.         }
  4.         if ($this->getHttpKernel() instanceof TerminableInterface) {
  5.             $this->getHttpKernel()->terminate($request$response);
  6.         }
  7.     }
  8.     /**
  9.      * {@inheritdoc}
Kernel->terminate() in public/index.php (line 31)
  1. $kernel = new Kernel($_SERVER['APP_ENV'], (bool) $_SERVER['APP_DEBUG']);
  2. $request Request::createFromGlobals();
  3. $response $kernel->handle($request);
  4. $response->send();
  5. $kernel->terminate($request$response);

Logs

No log messages

Stack Trace

UndefinedFunctionError
Symfony\Component\ErrorHandler\Error\UndefinedFunctionError:
Attempted to call function "bcadd" from namespace "App\Services\Fx".

  at src/Services/Fx/FxSafetyBufferPolicy.php:142
  at App\Services\Fx\FxSafetyBufferPolicy->normalizePercent()
     (src/Services/Fx/FxSafetyBufferPolicy.php:28)
  at App\Services\Fx\FxSafetyBufferPolicy->__construct()
     (var/cache/dev/ContainerSxeEifr/App_KernelDevDebugContainer.php:10676)
  at ContainerSxeEifr\App_KernelDevDebugContainer->getFxSafetyBufferPolicyService()
     (var/cache/dev/ContainerSxeEifr/App_KernelDevDebugContainer.php:10698)
  at ContainerSxeEifr\App_KernelDevDebugContainer->getFxServiceService()
     (var/cache/dev/ContainerSxeEifr/App_KernelDevDebugContainer.php:10491)
  at ContainerSxeEifr\App_KernelDevDebugContainer->getPaymentFxServiceService()
     (var/cache/dev/ContainerSxeEifr/App_KernelDevDebugContainer.php:11449)
  at ContainerSxeEifr\App_KernelDevDebugContainer->getPayadmitIntegrationServiceService()
     (var/cache/dev/ContainerSxeEifr/App_KernelDevDebugContainer.php:7232)
  at ContainerSxeEifr\App_KernelDevDebugContainer->getPayadmitWebhookTerminateSubscriberService()
     (var/cache/dev/ContainerSxeEifr/App_KernelDevDebugContainer.php:15422)
  at ContainerSxeEifr\App_KernelDevDebugContainer->ContainerSxeEifr\{closure}()
     (vendor/symfony/event-dispatcher/EventDispatcher.php:245)
  at Symfony\Component\EventDispatcher\EventDispatcher->sortListeners()
     (vendor/symfony/event-dispatcher/EventDispatcher.php:76)
  at Symfony\Component\EventDispatcher\EventDispatcher->getListeners()
     (vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php:293)
  at Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher->preProcess()
     (vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php:148)
  at Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher->dispatch()
     (vendor/symfony/http-kernel/HttpKernel.php:97)
  at Symfony\Component\HttpKernel\HttpKernel->terminate()
     (vendor/symfony/http-kernel/Kernel.php:159)
  at Symfony\Component\HttpKernel\Kernel->terminate()
     (public/index.php:31)                
Attempted to call function "bcadd" from namespace "App\Services\Fx". (500 Internal Server Error)

Symfony Exception

UndefinedFunctionError

HTTP 500 Internal Server Error

Attempted to call function "bcadd" from namespace "App\Services\Fx".

Exception

Symfony\Component\ErrorHandler\Error\ UndefinedFunctionError

  1.     {
  2.         $raw trim((string) $value);
  3.         if ($raw === '' || !is_numeric($raw) || stripos($raw'e') !== false) {
  4.             throw new \InvalidArgumentException(sprintf('Invalid FX safety buffer percent: "%s"'$raw));
  5.         }
  6.         $normalized bcadd($raw'0'4);
  7.         if (bccomp($normalized'0'4) < || bccomp($normalized'50'4) > 0) {
  8.             throw new \InvalidArgumentException('FX safety buffer percent must be between 0 and 50');
  9.         }
  10.         return $normalized;
FxSafetyBufferPolicy->normalizePercent() in /var/www/betbit-new/app/src/Services/Fx/FxSafetyBufferPolicy.php (line 28)
  1.     /**
  2.      * @param int|float|string $bufferPercent Percent points, e.g. 5 for 5%.
  3.      */
  4.     public function __construct($bufferPercent 5, ?EntityManagerInterface $entityManager null)
  5.     {
  6.         $this->defaultPercent $this->normalizePercent($bufferPercent);
  7.         $this->entityManager $entityManager;
  8.     }
  9.     public function getPolicyName(): string
  10.     {
  1.         if (isset($this->services['App\\Services\\Fx\\FxSafetyBufferPolicy'])) {
  2.             return $this->services['App\\Services\\Fx\\FxSafetyBufferPolicy'];
  3.         }
  4.         return $this->services['App\\Services\\Fx\\FxSafetyBufferPolicy'] = new \App\Services\Fx\FxSafetyBufferPolicy($this->getEnv('int:FX_SAFETY_BUFFER_PERCENT'), $a);
  5.     }
  6.     /**
  7.      * Gets the public 'App\Services\Fx\FxService' shared autowired service.
  8.      *
  1.         $b = ($this->services['App\\Services\\Fx\\DatabaseFxRateProvider'] ?? $this->getDatabaseFxRateProviderService());
  2.         if (isset($this->services['App\\Services\\Fx\\FxService'])) {
  3.             return $this->services['App\\Services\\Fx\\FxService'];
  4.         }
  5.         $c = ($this->services['App\\Services\\Fx\\FxSafetyBufferPolicy'] ?? $this->getFxSafetyBufferPolicyService());
  6.         if (isset($this->services['App\\Services\\Fx\\FxService'])) {
  7.             return $this->services['App\\Services\\Fx\\FxService'];
  8.         }
  1.      */
  2.     protected function getPaymentFxServiceService()
  3.     {
  4.         include_once \dirname(__DIR__4).'/src/Services/Currency/PaymentFxService.php';
  5.         $a = ($this->services['App\\Services\\Fx\\FxService'] ?? $this->getFxServiceService());
  6.         if (isset($this->services['App\\Services\\Currency\\PaymentFxService'])) {
  7.             return $this->services['App\\Services\\Currency\\PaymentFxService'];
  8.         }
  9.         $b = ($this->services['App\\Services\\Currency\\LedgerCurrencyService'] ?? $this->getLedgerCurrencyServiceService());
  1.         $a = ($this->services['doctrine.orm.default_entity_manager'] ?? $this->getDoctrine_Orm_DefaultEntityManagerService());
  2.         if (isset($this->services['App\\Services\\Integration\\Payadmit\\PayadmitIntegrationService'])) {
  3.             return $this->services['App\\Services\\Integration\\Payadmit\\PayadmitIntegrationService'];
  4.         }
  5.         $b = ($this->services['App\\Services\\Currency\\PaymentFxService'] ?? $this->getPaymentFxServiceService());
  6.         if (isset($this->services['App\\Services\\Integration\\Payadmit\\PayadmitIntegrationService'])) {
  7.             return $this->services['App\\Services\\Integration\\Payadmit\\PayadmitIntegrationService'];
  8.         }
  9.         $c = ($this->services['App\\Services\\Currency\\LedgerCurrencyService'] ?? $this->getLedgerCurrencyServiceService());
  1.     protected function getPayadmitWebhookTerminateSubscriberService()
  2.     {
  3.         include_once \dirname(__DIR__4).'/src/EventSubscriber/PayadmitWebhookTerminateSubscriber.php';
  4.         include_once \dirname(__DIR__4).'/src/Services/Integration/Payadmit/PayadmitAsyncWebhookBuffer.php';
  5.         $a = ($this->services['App\\Services\\Integration\\Payadmit\\PayadmitIntegrationService'] ?? $this->getPayadmitIntegrationServiceService());
  6.         if (isset($this->services['App\\EventSubscriber\\PayadmitWebhookTerminateSubscriber'])) {
  7.             return $this->services['App\\EventSubscriber\\PayadmitWebhookTerminateSubscriber'];
  8.         }
in /var/www/betbit-new/app/var/cache/dev/ContainerSxeEifr/App_KernelDevDebugContainer.php -> getPayadmitWebhookTerminateSubscriberService (line 15422)
  1.         }, => 'onKernelRequest'], 5);
  2.         $instance->addListener('Symfony\\Component\\Security\\Http\\Event\\LogoutEvent', [=> function () {
  3.             return ($this->services['App\\EventSubscriber\\LogoutSubscriber'] ?? $this->getLogoutSubscriberService());
  4.         }, => 'onLogoutEvent'], 0);
  5.         $instance->addListener('kernel.terminate', [=> function () {
  6.             return ($this->services['App\\EventSubscriber\\PayadmitWebhookTerminateSubscriber'] ?? $this->getPayadmitWebhookTerminateSubscriberService());
  7.         }, => 'onKernelTerminate'], 0);
  8.         $instance->addListener('kernel.response', [=> function () {
  9.             return ($this->services['App\\EventSubscriber\\SessionCookieDedupSubscriber'] ?? ($this->services['App\\EventSubscriber\\SessionCookieDedupSubscriber'] = new \App\EventSubscriber\SessionCookieDedupSubscriber()));
  10.         }, => 'onKernelResponse'], -1010);
  11.         $instance->addListener('kernel.request', [=> function () {
  1.             foreach ($listeners as &$listener) {
  2.                 $closure = &$this->optimized[$eventName][];
  3.                 if (\is_array($listener) && isset($listener[0]) && $listener[0] instanceof \Closure && >= \count($listener)) {
  4.                     $closure = static function (...$args) use (&$listener, &$closure) {
  5.                         if ($listener[0] instanceof \Closure) {
  6.                             $listener[0] = $listener[0]();
  7.                             $listener[1] = $listener[1] ?? '__invoke';
  8.                         }
  9.                         ($closure \Closure::fromCallable($listener))(...$args);
  10.                     };
  11.                 } else {
in /var/www/betbit-new/app/vendor/symfony/event-dispatcher/EventDispatcher.php :: Symfony\Component\EventDispatcher\{closure} (line 230)
  1.         foreach ($listeners as $listener) {
  2.             if ($stoppable && $event->isPropagationStopped()) {
  3.                 break;
  4.             }
  5.             $listener($event$eventName$this);
  6.         }
  7.     }
  8.     /**
  9.      * Sorts the internal list of listeners for the given event by priority.
  1.         } else {
  2.             $listeners $this->getListeners($eventName);
  3.         }
  4.         if ($listeners) {
  5.             $this->callListeners($listeners$eventName$event);
  6.         }
  7.         return $event;
  8.     }
  1.         try {
  2.             $this->beforeDispatch($eventName$event);
  3.             try {
  4.                 $e $this->stopwatch->start($eventName'section');
  5.                 try {
  6.                     $this->dispatcher->dispatch($event$eventName);
  7.                 } finally {
  8.                     if ($e->isStarted()) {
  9.                         $e->stop();
  10.                     }
  11.                 }
  1.     /**
  2.      * {@inheritdoc}
  3.      */
  4.     public function terminate(Request $requestResponse $response)
  5.     {
  6.         $this->dispatcher->dispatch(new TerminateEvent($this$request$response), KernelEvents::TERMINATE);
  7.     }
  8.     /**
  9.      * @internal
  10.      */
  1.         }
  2.         $response->sendHeaders();
  3.         $response->sendContent();
  4.         $this->terminate($request$response);
  5.     }
  6.     /**
  7.      * Handles a request to convert it to a response.
  8.      *
  1.                         if ($hasRun) {
  2.                             throw $e;
  3.                         }
  4.                         $hasRun true;
  5.                         $kernel->terminateWithException($e$request);
  6.                     };
  7.                 }
  8.             } elseif ($event instanceof ConsoleEvent && $app $event->getCommand()->getApplication()) {
  9.                 $output $event->getOutput();
  10.                 if ($output instanceof ConsoleOutputInterface) {
in /var/www/betbit-new/app/vendor/symfony/error-handler/ErrorHandler.php :: Symfony\Component\HttpKernel\EventListener\{closure} (line 537)
  1.             $this->exceptionHandler null;
  2.         }
  3.         try {
  4.             if (null !== $exceptionHandler) {
  5.                 $exceptionHandler($exception);
  6.                 return;
  7.             }
  8.             $handlerException ??= $exception;
  9.         } catch (\Throwable $handlerException) {
ErrorHandler->handleException()

Stack Trace

UndefinedFunctionError
Symfony\Component\ErrorHandler\Error\UndefinedFunctionError:
Attempted to call function "bcadd" from namespace "App\Services\Fx".

  at /var/www/betbit-new/app/src/Services/Fx/FxSafetyBufferPolicy.php:142
  at App\Services\Fx\FxSafetyBufferPolicy->normalizePercent()
     (/var/www/betbit-new/app/src/Services/Fx/FxSafetyBufferPolicy.php:28)
  at App\Services\Fx\FxSafetyBufferPolicy->__construct()
     (/var/www/betbit-new/app/var/cache/dev/ContainerSxeEifr/App_KernelDevDebugContainer.php:10676)
  at ContainerSxeEifr\App_KernelDevDebugContainer->getFxSafetyBufferPolicyService()
     (/var/www/betbit-new/app/var/cache/dev/ContainerSxeEifr/App_KernelDevDebugContainer.php:10698)
  at ContainerSxeEifr\App_KernelDevDebugContainer->getFxServiceService()
     (/var/www/betbit-new/app/var/cache/dev/ContainerSxeEifr/App_KernelDevDebugContainer.php:10491)
  at ContainerSxeEifr\App_KernelDevDebugContainer->getPaymentFxServiceService()
     (/var/www/betbit-new/app/var/cache/dev/ContainerSxeEifr/App_KernelDevDebugContainer.php:11449)
  at ContainerSxeEifr\App_KernelDevDebugContainer->getPayadmitIntegrationServiceService()
     (/var/www/betbit-new/app/var/cache/dev/ContainerSxeEifr/App_KernelDevDebugContainer.php:7232)
  at ContainerSxeEifr\App_KernelDevDebugContainer->getPayadmitWebhookTerminateSubscriberService()
     (/var/www/betbit-new/app/var/cache/dev/ContainerSxeEifr/App_KernelDevDebugContainer.php:15422)
  at ContainerSxeEifr\App_KernelDevDebugContainer->ContainerSxeEifr\{closure}()
     (/var/www/betbit-new/app/vendor/symfony/event-dispatcher/EventDispatcher.php:267)
  at Symfony\Component\EventDispatcher\EventDispatcher::Symfony\Component\EventDispatcher\{closure}()
     (/var/www/betbit-new/app/vendor/symfony/event-dispatcher/EventDispatcher.php:230)
  at Symfony\Component\EventDispatcher\EventDispatcher->callListeners()
     (/var/www/betbit-new/app/vendor/symfony/event-dispatcher/EventDispatcher.php:59)
  at Symfony\Component\EventDispatcher\EventDispatcher->dispatch()
     (/var/www/betbit-new/app/vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php:154)
  at Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher->dispatch()
     (/var/www/betbit-new/app/vendor/symfony/http-kernel/HttpKernel.php:97)
  at Symfony\Component\HttpKernel\HttpKernel->terminate()
     (/var/www/betbit-new/app/vendor/symfony/http-kernel/HttpKernel.php:124)
  at Symfony\Component\HttpKernel\HttpKernel->terminateWithException()
     (/var/www/betbit-new/app/vendor/symfony/http-kernel/EventListener/DebugHandlersListener.php:132)
  at Symfony\Component\HttpKernel\EventListener\DebugHandlersListener::Symfony\Component\HttpKernel\EventListener\{closure}()
     (/var/www/betbit-new/app/vendor/symfony/error-handler/ErrorHandler.php:537)
  at Symfony\Component\ErrorHandler\ErrorHandler->handleException()