/** * @param ValidatorInterface $validator * @param EmitterInterface $emitter * @param Gateway $gateway * @param PaymentRepositoryInterface $repository * * @return static */ public static function create(ValidatorInterface $validator, EmitterInterface $emitter, Gateway $gateway, PaymentRepositoryInterface $repository) { /** @var self $handler */ $handler = parent::createBasic($validator, $emitter); $handler->gateway = $gateway; $handler->repository = $repository; return $handler; }
/** * Custom builder used to inject logger service * * @param ValidatorInterface $validator * @param EmitterInterface $emitter * @param LoggerInterface $logger * * @return self */ public static function createWithLogger(ValidatorInterface $validator, EmitterInterface $emitter, LoggerInterface $logger) { /** @var self $handler */ $handler = parent::createBasic($validator, $emitter); $handler->logger = $logger; return $handler; }