| Conditions | 1 |
| Paths | 1 |
| Total Lines | 23 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 21 | function trigger( |
||
|
|
|||
| 22 | $hubId, |
||
| 23 | $eventId, |
||
| 24 | $contactEmail = null, |
||
| 25 | $contactRevenue = null, |
||
| 26 | $contactProperties = [] |
||
| 27 | ) { |
||
| 28 | $endpoint = "http://track.hubspot.com/v1/event"; |
||
| 29 | |||
| 30 | $required['_a'] = $hubId; |
||
| 31 | $required['_n'] = $eventId; |
||
| 32 | $required['email'] = $contactEmail; |
||
| 33 | |||
| 34 | $parameters = array_merge( |
||
| 35 | $required, |
||
| 36 | ['_m' => $contactRevenue], |
||
| 37 | $contactProperties |
||
| 38 | ); |
||
| 39 | |||
| 40 | $query_string = build_query_string($parameters); |
||
| 41 | |||
| 42 | return $this->client->request('get', $endpoint, [], $query_string, false); |
||
| 43 | } |
||
| 44 | } |
||
| 45 |
Adding explicit visibility (
private,protected, orpublic) is generally recommend to communicate to other developers how, and from where this method is intended to be used.