vendor/symfony/event-dispatcher/EventDispatcher.php line 245

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\EventDispatcher;
  11. use Psr\EventDispatcher\StoppableEventInterface;
  12. use Symfony\Component\EventDispatcher\Debug\WrappedListener;
  13. /**
  14. * The EventDispatcherInterface is the central point of Symfony's event listener system.
  15. *
  16. * Listeners are registered on the manager and events are dispatched through the
  17. * manager.
  18. *
  19. * @author Guilherme Blanco <[email protected]>
  20. * @author Jonathan Wage <[email protected]>
  21. * @author Roman Borschel <[email protected]>
  22. * @author Bernhard Schussek <[email protected]>
  23. * @author Fabien Potencier <[email protected]>
  24. * @author Jordi Boggiano <[email protected]>
  25. * @author Jordan Alliot <[email protected]>
  26. * @author Nicolas Grekas <[email protected]>
  27. */
  28. class EventDispatcher implements EventDispatcherInterface
  29. {
  30. private $listeners = [];
  31. private $sorted = [];
  32. private $optimized;
  33. public function __construct()
  34. {
  35. if (__CLASS__ === static::class) {
  36. $this->optimized = [];
  37. }
  38. }
  39. /**
  40. * {@inheritdoc}
  41. */
  42. public function dispatch(object $event, ?string $eventName = null): object
  43. {
  44. $eventName = $eventName ?? \get_class($event);
  45. if (null !== $this->optimized) {
  46. $listeners = $this->optimized[$eventName] ?? (empty($this->listeners[$eventName]) ? [] : $this->optimizeListeners($eventName));
  47. } else {
  48. $listeners = $this->getListeners($eventName);
  49. }
  50. if ($listeners) {
  51. $this->callListeners($listeners, $eventName, $event);
  52. }
  53. return $event;
  54. }
  55. /**
  56. * {@inheritdoc}
  57. */
  58. public function getListeners(?string $eventName = null)
  59. {
  60. if (null !== $eventName) {
  61. if (empty($this->listeners[$eventName])) {
  62. return [];
  63. }
  64. if (!isset($this->sorted[$eventName])) {
  65. $this->sortListeners($eventName);
  66. }
  67. return $this->sorted[$eventName];
  68. }
  69. foreach ($this->listeners as $eventName => $eventListeners) {
  70. if (!isset($this->sorted[$eventName])) {
  71. $this->sortListeners($eventName);
  72. }
  73. }
  74. return array_filter($this->sorted);
  75. }
  76. /**
  77. * {@inheritdoc}
  78. */
  79. public function getListenerPriority(string $eventName, $listener)
  80. {
  81. if (empty($this->listeners[$eventName])) {
  82. return null;
  83. }
  84. if (\is_array($listener) && isset($listener[0]) && $listener[0] instanceof \Closure && 2 >= \count($listener)) {
  85. $listener[0] = $listener[0]();
  86. $listener[1] = $listener[1] ?? '__invoke';
  87. }
  88. foreach ($this->listeners[$eventName] as $priority => &$listeners) {
  89. foreach ($listeners as &$v) {
  90. if ($v !== $listener && \is_array($v) && isset($v[0]) && $v[0] instanceof \Closure && 2 >= \count($v)) {
  91. $v[0] = $v[0]();
  92. $v[1] = $v[1] ?? '__invoke';
  93. }
  94. if ($v === $listener || ($listener instanceof \Closure && $v == $listener)) {
  95. return $priority;
  96. }
  97. }
  98. }
  99. return null;
  100. }
  101. /**
  102. * {@inheritdoc}
  103. */
  104. public function hasListeners(?string $eventName = null)
  105. {
  106. if (null !== $eventName) {
  107. return !empty($this->listeners[$eventName]);
  108. }
  109. foreach ($this->listeners as $eventListeners) {
  110. if ($eventListeners) {
  111. return true;
  112. }
  113. }
  114. return false;
  115. }
  116. /**
  117. * {@inheritdoc}
  118. */
  119. public function addListener(string $eventName, $listener, int $priority = 0)
  120. {
  121. $this->listeners[$eventName][$priority][] = $listener;
  122. unset($this->sorted[$eventName], $this->optimized[$eventName]);
  123. }
  124. /**
  125. * {@inheritdoc}
  126. */
  127. public function removeListener(string $eventName, $listener)
  128. {
  129. if (empty($this->listeners[$eventName])) {
  130. return;
  131. }
  132. if (\is_array($listener) && isset($listener[0]) && $listener[0] instanceof \Closure && 2 >= \count($listener)) {
  133. $listener[0] = $listener[0]();
  134. $listener[1] = $listener[1] ?? '__invoke';
  135. }
  136. foreach ($this->listeners[$eventName] as $priority => &$listeners) {
  137. foreach ($listeners as $k => &$v) {
  138. if ($v !== $listener && \is_array($v) && isset($v[0]) && $v[0] instanceof \Closure && 2 >= \count($v)) {
  139. $v[0] = $v[0]();
  140. $v[1] = $v[1] ?? '__invoke';
  141. }
  142. if ($v === $listener || ($listener instanceof \Closure && $v == $listener)) {
  143. unset($listeners[$k], $this->sorted[$eventName], $this->optimized[$eventName]);
  144. }
  145. }
  146. if (!$listeners) {
  147. unset($this->listeners[$eventName][$priority]);
  148. }
  149. }
  150. }
  151. /**
  152. * {@inheritdoc}
  153. */
  154. public function addSubscriber(EventSubscriberInterface $subscriber)
  155. {
  156. foreach ($subscriber->getSubscribedEvents() as $eventName => $params) {
  157. if (\is_string($params)) {
  158. $this->addListener($eventName, [$subscriber, $params]);
  159. } elseif (\is_string($params[0])) {
  160. $this->addListener($eventName, [$subscriber, $params[0]], $params[1] ?? 0);
  161. } else {
  162. foreach ($params as $listener) {
  163. $this->addListener($eventName, [$subscriber, $listener[0]], $listener[1] ?? 0);
  164. }
  165. }
  166. }
  167. }
  168. /**
  169. * {@inheritdoc}
  170. */
  171. public function removeSubscriber(EventSubscriberInterface $subscriber)
  172. {
  173. foreach ($subscriber->getSubscribedEvents() as $eventName => $params) {
  174. if (\is_array($params) && \is_array($params[0])) {
  175. foreach ($params as $listener) {
  176. $this->removeListener($eventName, [$subscriber, $listener[0]]);
  177. }
  178. } else {
  179. $this->removeListener($eventName, [$subscriber, \is_string($params) ? $params : $params[0]]);
  180. }
  181. }
  182. }
  183. /**
  184. * Triggers the listeners of an event.
  185. *
  186. * This method can be overridden to add functionality that is executed
  187. * for each listener.
  188. *
  189. * @param callable[] $listeners The event listeners
  190. * @param string $eventName The name of the event to dispatch
  191. * @param object $event The event object to pass to the event handlers/listeners
  192. */
  193. protected function callListeners(iterable $listeners, string $eventName, object $event)
  194. {
  195. $stoppable = $event instanceof StoppableEventInterface;
  196. foreach ($listeners as $listener) {
  197. if ($stoppable && $event->isPropagationStopped()) {
  198. break;
  199. }
  200. $listener($event, $eventName, $this);
  201. }
  202. }
  203. /**
  204. * Sorts the internal list of listeners for the given event by priority.
  205. */
  206. private function sortListeners(string $eventName)
  207. {
  208. krsort($this->listeners[$eventName]);
  209. $this->sorted[$eventName] = [];
  210. foreach ($this->listeners[$eventName] as &$listeners) {
  211. foreach ($listeners as $k => &$listener) {
  212. if (\is_array($listener) && isset($listener[0]) && $listener[0] instanceof \Closure && 2 >= \count($listener)) {
  213. $listener[0] = $listener[0]();
  214. $listener[1] = $listener[1] ?? '__invoke';
  215. }
  216. $this->sorted[$eventName][] = $listener;
  217. }
  218. }
  219. }
  220. /**
  221. * Optimizes the internal list of listeners for the given event by priority.
  222. */
  223. private function optimizeListeners(string $eventName): array
  224. {
  225. krsort($this->listeners[$eventName]);
  226. $this->optimized[$eventName] = [];
  227. foreach ($this->listeners[$eventName] as &$listeners) {
  228. foreach ($listeners as &$listener) {
  229. $closure = &$this->optimized[$eventName][];
  230. if (\is_array($listener) && isset($listener[0]) && $listener[0] instanceof \Closure && 2 >= \count($listener)) {
  231. $closure = static function (...$args) use (&$listener, &$closure) {
  232. if ($listener[0] instanceof \Closure) {
  233. $listener[0] = $listener[0]();
  234. $listener[1] = $listener[1] ?? '__invoke';
  235. }
  236. ($closure = \Closure::fromCallable($listener))(...$args);
  237. };
  238. } else {
  239. $closure = $listener instanceof \Closure || $listener instanceof WrappedListener ? $listener : \Closure::fromCallable($listener);
  240. }
  241. }
  242. }
  243. return $this->optimized[$eventName];
  244. }
  245. }
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()