Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
language: php
php:
- nightly
script:
- composer install
- ./vendor/bin/codecept run unit
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Eventmapper PHP

[![Build Status](https://travis-ci.org/WajoxSoftware/php-eventmapper-lib.svg?branch=version-2)](https://travis-ci.org/WajoxSoftware/php-eventmapper-lib)
## Write and use event handler
1. Create your class by extending wajox\eventmapper\AbstractEventHandler
2. Put your handler code into method run(), the method should return boolean value
Expand Down
14 changes: 8 additions & 6 deletions src/publishers/HttpEventPublisher.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,13 @@ protected function sendRequest($rKey, $event)
'POST',
$this->buildRequestUrl($rKey),
[
'headers' => [
'Content-Type' => 'application/json'
],
'headers' => array_merge(
[
'Content-Type' => 'application/json',
'Auth-Token' => $this->getOption('token'),
],
$this->getOption('headers')
),
'body' => \json_encode($event),
]
);
Expand All @@ -100,8 +104,6 @@ protected function sendRequest($rKey, $event)
*/
protected function buildRequestUrl($rKey)
{
return $this->getOption('url')
. '/' . $rKey . '/events'
. '?token=' . $this->getOption('token');
return $this->getOption('url') . '/' . $rKey . '/events';
}
}