| Conditions | 2 |
| Paths | 2 |
| Total Lines | 19 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 19 | public function __construct(EnvelopeInterface $envelope) |
||
| 20 | { |
||
| 21 | // Building request |
||
| 22 | $ids = array(); |
||
| 23 | foreach ($envelope->getIdentities() as $id) { |
||
| 24 | $ids[] = $id->getType() . '=' . $id->getId(); |
||
| 25 | } |
||
| 26 | |||
| 27 | $packet = array('type' => $envelope->getType(), 'sequence_id' => $envelope->getSequenceId()); |
||
| 28 | |||
| 29 | parent::__construct( |
||
| 30 | 'POST', |
||
| 31 | TransportInterface::DEFAULT_URL . 'api/sendEvent', |
||
| 32 | array( |
||
| 33 | 'X-Identities' => implode('&', $ids) |
||
| 34 | ), |
||
| 35 | json_encode(array_merge($packet, $envelope->toArray())) |
||
| 36 | ); |
||
| 37 | } |
||
| 38 | } |
||
| 39 |