vendor/symfony/event-dispatcher/Debug/TraceableEventDispatcher.php line 148

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\Debug;
  11. use Psr\EventDispatcher\StoppableEventInterface;
  12. use Psr\Log\LoggerInterface;
  13. use Symfony\Component\EventDispatcher\EventDispatcherInterface;
  14. use Symfony\Component\EventDispatcher\EventSubscriberInterface;
  15. use Symfony\Component\HttpFoundation\Request;
  16. use Symfony\Component\HttpFoundation\RequestStack;
  17. use Symfony\Component\Stopwatch\Stopwatch;
  18. use Symfony\Contracts\Service\ResetInterface;
  19. /**
  20. * Collects some data about event listeners.
  21. *
  22. * This event dispatcher delegates the dispatching to another one.
  23. *
  24. * @author Fabien Potencier <[email protected]>
  25. */
  26. class TraceableEventDispatcher implements EventDispatcherInterface, ResetInterface
  27. {
  28. protected $logger;
  29. protected $stopwatch;
  30. /**
  31. * @var \SplObjectStorage<WrappedListener, array{string, string}>
  32. */
  33. private $callStack;
  34. private $dispatcher;
  35. private $wrappedListeners;
  36. private $orphanedEvents;
  37. private $requestStack;
  38. private $currentRequestHash = '';
  39. public function __construct(EventDispatcherInterface $dispatcher, Stopwatch $stopwatch, ?LoggerInterface $logger = null, ?RequestStack $requestStack = null)
  40. {
  41. $this->dispatcher = $dispatcher;
  42. $this->stopwatch = $stopwatch;
  43. $this->logger = $logger;
  44. $this->wrappedListeners = [];
  45. $this->orphanedEvents = [];
  46. $this->requestStack = $requestStack;
  47. }
  48. /**
  49. * {@inheritdoc}
  50. */
  51. public function addListener(string $eventName, $listener, int $priority = 0)
  52. {
  53. $this->dispatcher->addListener($eventName, $listener, $priority);
  54. }
  55. /**
  56. * {@inheritdoc}
  57. */
  58. public function addSubscriber(EventSubscriberInterface $subscriber)
  59. {
  60. $this->dispatcher->addSubscriber($subscriber);
  61. }
  62. /**
  63. * {@inheritdoc}
  64. */
  65. public function removeListener(string $eventName, $listener)
  66. {
  67. if (isset($this->wrappedListeners[$eventName])) {
  68. foreach ($this->wrappedListeners[$eventName] as $index => $wrappedListener) {
  69. if ($wrappedListener->getWrappedListener() === $listener || ($listener instanceof \Closure && $wrappedListener->getWrappedListener() == $listener)) {
  70. $listener = $wrappedListener;
  71. unset($this->wrappedListeners[$eventName][$index]);
  72. break;
  73. }
  74. }
  75. }
  76. return $this->dispatcher->removeListener($eventName, $listener);
  77. }
  78. /**
  79. * {@inheritdoc}
  80. */
  81. public function removeSubscriber(EventSubscriberInterface $subscriber)
  82. {
  83. return $this->dispatcher->removeSubscriber($subscriber);
  84. }
  85. /**
  86. * {@inheritdoc}
  87. */
  88. public function getListeners(?string $eventName = null)
  89. {
  90. return $this->dispatcher->getListeners($eventName);
  91. }
  92. /**
  93. * {@inheritdoc}
  94. */
  95. public function getListenerPriority(string $eventName, $listener)
  96. {
  97. // we might have wrapped listeners for the event (if called while dispatching)
  98. // in that case get the priority by wrapper
  99. if (isset($this->wrappedListeners[$eventName])) {
  100. foreach ($this->wrappedListeners[$eventName] as $wrappedListener) {
  101. if ($wrappedListener->getWrappedListener() === $listener || ($listener instanceof \Closure && $wrappedListener->getWrappedListener() == $listener)) {
  102. return $this->dispatcher->getListenerPriority($eventName, $wrappedListener);
  103. }
  104. }
  105. }
  106. return $this->dispatcher->getListenerPriority($eventName, $listener);
  107. }
  108. /**
  109. * {@inheritdoc}
  110. */
  111. public function hasListeners(?string $eventName = null)
  112. {
  113. return $this->dispatcher->hasListeners($eventName);
  114. }
  115. /**
  116. * {@inheritdoc}
  117. */
  118. public function dispatch(object $event, ?string $eventName = null): object
  119. {
  120. $eventName = $eventName ?? \get_class($event);
  121. if (null === $this->callStack) {
  122. $this->callStack = new \SplObjectStorage();
  123. }
  124. $currentRequestHash = $this->currentRequestHash = $this->requestStack && ($request = $this->requestStack->getCurrentRequest()) ? spl_object_hash($request) : '';
  125. if (null !== $this->logger && $event instanceof StoppableEventInterface && $event->isPropagationStopped()) {
  126. $this->logger->debug(sprintf('The "%s" event is already stopped. No listeners have been called.', $eventName));
  127. }
  128. $this->preProcess($eventName);
  129. try {
  130. $this->beforeDispatch($eventName, $event);
  131. try {
  132. $e = $this->stopwatch->start($eventName, 'section');
  133. try {
  134. $this->dispatcher->dispatch($event, $eventName);
  135. } finally {
  136. if ($e->isStarted()) {
  137. $e->stop();
  138. }
  139. }
  140. } finally {
  141. $this->afterDispatch($eventName, $event);
  142. }
  143. } finally {
  144. $this->currentRequestHash = $currentRequestHash;
  145. $this->postProcess($eventName);
  146. }
  147. return $event;
  148. }
  149. /**
  150. * @return array
  151. */
  152. public function getCalledListeners(?Request $request = null)
  153. {
  154. if (null === $this->callStack) {
  155. return [];
  156. }
  157. $hash = $request ? spl_object_hash($request) : null;
  158. $called = [];
  159. foreach ($this->callStack as $listener) {
  160. [$eventName, $requestHash] = $this->callStack->getInfo();
  161. if (null === $hash || $hash === $requestHash) {
  162. $called[] = $listener->getInfo($eventName);
  163. }
  164. }
  165. return $called;
  166. }
  167. /**
  168. * @return array
  169. */
  170. public function getNotCalledListeners(?Request $request = null)
  171. {
  172. try {
  173. $allListeners = $this->getListeners();
  174. } catch (\Exception $e) {
  175. if (null !== $this->logger) {
  176. $this->logger->info('An exception was thrown while getting the uncalled listeners.', ['exception' => $e]);
  177. }
  178. // unable to retrieve the uncalled listeners
  179. return [];
  180. }
  181. $hash = $request ? spl_object_hash($request) : null;
  182. $calledListeners = [];
  183. if (null !== $this->callStack) {
  184. foreach ($this->callStack as $calledListener) {
  185. [, $requestHash] = $this->callStack->getInfo();
  186. if (null === $hash || $hash === $requestHash) {
  187. $calledListeners[] = $calledListener->getWrappedListener();
  188. }
  189. }
  190. }
  191. $notCalled = [];
  192. foreach ($allListeners as $eventName => $listeners) {
  193. foreach ($listeners as $listener) {
  194. if (!\in_array($listener, $calledListeners, true)) {
  195. if (!$listener instanceof WrappedListener) {
  196. $listener = new WrappedListener($listener, null, $this->stopwatch, $this);
  197. }
  198. $notCalled[] = $listener->getInfo($eventName);
  199. }
  200. }
  201. }
  202. uasort($notCalled, [$this, 'sortNotCalledListeners']);
  203. return $notCalled;
  204. }
  205. public function getOrphanedEvents(?Request $request = null): array
  206. {
  207. if ($request) {
  208. return $this->orphanedEvents[spl_object_hash($request)] ?? [];
  209. }
  210. if (!$this->orphanedEvents) {
  211. return [];
  212. }
  213. return array_merge(...array_values($this->orphanedEvents));
  214. }
  215. public function reset()
  216. {
  217. $this->callStack = null;
  218. $this->orphanedEvents = [];
  219. $this->currentRequestHash = '';
  220. }
  221. /**
  222. * Proxies all method calls to the original event dispatcher.
  223. *
  224. * @param string $method The method name
  225. * @param array $arguments The method arguments
  226. *
  227. * @return mixed
  228. */
  229. public function __call(string $method, array $arguments)
  230. {
  231. return $this->dispatcher->{$method}(...$arguments);
  232. }
  233. /**
  234. * Called before dispatching the event.
  235. */
  236. protected function beforeDispatch(string $eventName, object $event)
  237. {
  238. }
  239. /**
  240. * Called after dispatching the event.
  241. */
  242. protected function afterDispatch(string $eventName, object $event)
  243. {
  244. }
  245. private function preProcess(string $eventName): void
  246. {
  247. if (!$this->dispatcher->hasListeners($eventName)) {
  248. $this->orphanedEvents[$this->currentRequestHash][] = $eventName;
  249. return;
  250. }
  251. foreach ($this->dispatcher->getListeners($eventName) as $listener) {
  252. $priority = $this->getListenerPriority($eventName, $listener);
  253. $wrappedListener = new WrappedListener($listener instanceof WrappedListener ? $listener->getWrappedListener() : $listener, null, $this->stopwatch, $this);
  254. $this->wrappedListeners[$eventName][] = $wrappedListener;
  255. $this->dispatcher->removeListener($eventName, $listener);
  256. $this->dispatcher->addListener($eventName, $wrappedListener, $priority);
  257. $this->callStack->attach($wrappedListener, [$eventName, $this->currentRequestHash]);
  258. }
  259. }
  260. private function postProcess(string $eventName): void
  261. {
  262. unset($this->wrappedListeners[$eventName]);
  263. $skipped = false;
  264. foreach ($this->dispatcher->getListeners($eventName) as $listener) {
  265. if (!$listener instanceof WrappedListener) { // #12845: a new listener was added during dispatch.
  266. continue;
  267. }
  268. // Unwrap listener
  269. $priority = $this->getListenerPriority($eventName, $listener);
  270. $this->dispatcher->removeListener($eventName, $listener);
  271. $this->dispatcher->addListener($eventName, $listener->getWrappedListener(), $priority);
  272. if (null !== $this->logger) {
  273. $context = ['event' => $eventName, 'listener' => $listener->getPretty()];
  274. }
  275. if ($listener->wasCalled()) {
  276. if (null !== $this->logger) {
  277. $this->logger->debug('Notified event "{event}" to listener "{listener}".', $context);
  278. }
  279. } else {
  280. $this->callStack->detach($listener);
  281. }
  282. if (null !== $this->logger && $skipped) {
  283. $this->logger->debug('Listener "{listener}" was not called for event "{event}".', $context);
  284. }
  285. if ($listener->stoppedPropagation()) {
  286. if (null !== $this->logger) {
  287. $this->logger->debug('Listener "{listener}" stopped propagation of the event "{event}".', $context);
  288. }
  289. $skipped = true;
  290. }
  291. }
  292. }
  293. private function sortNotCalledListeners(array $a, array $b)
  294. {
  295. if (0 !== $cmp = strcmp($a['event'], $b['event'])) {
  296. return $cmp;
  297. }
  298. if (\is_int($a['priority']) && !\is_int($b['priority'])) {
  299. return 1;
  300. }
  301. if (!\is_int($a['priority']) && \is_int($b['priority'])) {
  302. return -1;
  303. }
  304. if ($a['priority'] === $b['priority']) {
  305. return 0;
  306. }
  307. if ($a['priority'] > $b['priority']) {
  308. return -1;
  309. }
  310. return 1;
  311. }
  312. }
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()