Conditions | 3 |
Paths | 3 |
Total Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 0 |
1 | <?php |
||
26 | protected function validate( |
||
27 | IntegrationAssociation $record |
||
28 | ): bool { |
||
29 | |||
30 | $field = $record->getField(); |
||
31 | |||
32 | if (!$field instanceof ObjectsFieldInterface) { |
||
33 | return false; |
||
34 | } |
||
35 | |||
36 | /** @var ResponseInterface $response */ |
||
37 | $response = $field->readFromHubSpot( |
||
38 | $record->objectId |
||
39 | ); |
||
40 | |||
41 | return $response->getStatusCode() >= 200 && $response->getStatusCode() <= 299; |
||
42 | } |
||
43 | } |
||
44 |