<?php
namespace League\Event;
class OneTimeListener implements ListenerInterface
{
/**
* The listener instance.
*
* @var ListenerInterface
*/
protected $listener;
/**
* Create a new one time listener instance.
*
* @param ListenerInterface $listener
*/
public function __construct(ListenerInterface $listener)
{
$this->listener = $listener;
}
/**
* Get the wrapped listener.
*
* @return ListenerInterface
*/
public function getWrappedListener()
{
return $this->listener;
}
/**
* @inheritdoc
*/
public function handle(EventInterface $event)
{
$name = $event->getName();
$emitter = $event->getEmitter();
$emitter->removeListener($name, $this->listener);
return call_user_func_array([$this->listener, 'handle'], func_get_args());
}
/**
* @inheritdoc
*/
public function isListener($listener)
{
if ($listener instanceof OneTimeListener) {
$listener = $listener->getWrappedListener();
}
return $this->listener->isListener($listener);
}
}
How To Payment
Making a payment on our website is quick and secure. Start by logging in or creating an account. Select your preferred payment method, input the required details, and review the information. Once you confirm everything is correct, click on the "Submit Payment" button. You’ll receive instant confirmation and can track your payment status through your account dashboard. It’s an easy and secure process.