1 | <?php |
||
31 | class HttpProtocol implements ProtocolInterface |
||
32 | { |
||
33 | /** |
||
34 | * @var AuthenticatorInterface |
||
35 | */ |
||
36 | private $authenticator; |
||
37 | |||
38 | /** |
||
39 | * @var HttpSenderInterface |
||
40 | */ |
||
41 | private $httpSender; |
||
42 | |||
43 | /** |
||
44 | * @var PayloadEncoderInterface |
||
45 | */ |
||
46 | private $payloadEncoder; |
||
47 | |||
48 | /** |
||
49 | * @var UriFactoryInterface |
||
50 | */ |
||
51 | private $uriFactory; |
||
52 | |||
53 | /** |
||
54 | * @var HttpProtocolVisitorInterface |
||
55 | */ |
||
56 | private $visitor; |
||
57 | |||
58 | /** |
||
59 | * @var ExceptionFactoryInterface |
||
60 | */ |
||
61 | private $exceptionFactory; |
||
62 | |||
63 | /** |
||
64 | * Constructor. |
||
65 | * |
||
66 | * @param AuthenticatorInterface $authenticator |
||
67 | * @param HttpSenderInterface $httpSender |
||
68 | * @param PayloadEncoderInterface $payloadEncoder |
||
69 | * @param UriFactoryInterface $uriFactory |
||
70 | * @param HttpProtocolVisitorInterface $visitor |
||
71 | * @param ExceptionFactoryInterface $exceptionFactory |
||
72 | */ |
||
73 | public function __construct(AuthenticatorInterface $authenticator, HttpSenderInterface $httpSender, PayloadEncoderInterface $payloadEncoder, UriFactoryInterface $uriFactory, HttpProtocolVisitorInterface $visitor, ExceptionFactoryInterface $exceptionFactory) |
||
82 | |||
83 | /** |
||
84 | * {@inheritdoc} |
||
85 | * |
||
86 | * @throws HttpSenderException |
||
87 | */ |
||
88 | public function send(Receiver $receiver, Notification $notification, bool $sandbox): void |
||
98 | |||
99 | /** |
||
100 | * {@inheritdoc} |
||
101 | */ |
||
102 | public function closeConnection(): void |
||
106 | |||
107 | /** |
||
108 | * Inner send process |
||
109 | * |
||
110 | * @param Receiver $receiver |
||
111 | * @param Notification $notification |
||
112 | * @param bool $sandbox |
||
113 | * |
||
114 | * @throws SendNotificationException |
||
115 | * @throws HttpSenderException |
||
116 | */ |
||
117 | private function doSend(Receiver $receiver, Notification $notification, bool $sandbox): void |
||
141 | } |
||
142 |