| Conditions | 2 |
| Paths | 2 |
| Total Lines | 21 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php |
||
| 26 | public function getVisitor(bool $toQueue = true, string $connection = null) |
||
| 27 | { |
||
| 28 | try { |
||
| 29 | return HubSpotPlugin::getInstance()->getVisitor()->findContact($toQueue, $connection); |
||
| 30 | } catch (\Exception $e) { |
||
| 31 | HubSpotPlugin::warning( |
||
| 32 | sprintf( |
||
| 33 | "Exception caught while trying to get HubSpot Visitor. Exception: [%s].", |
||
| 34 | (string)Json::encode([ |
||
| 35 | 'Trace' => $e->getTraceAsString(), |
||
| 36 | 'File' => $e->getFile(), |
||
| 37 | 'Line' => $e->getLine(), |
||
| 38 | 'Code' => $e->getCode(), |
||
| 39 | 'Message' => $e->getMessage() |
||
| 40 | ]) |
||
| 41 | ), |
||
| 42 | __METHOD__ |
||
| 43 | ); |
||
| 44 | return null; |
||
| 45 | } |
||
| 46 | } |
||
| 47 | } |
||
| 48 |