Total Complexity | 4 |
Total Lines | 48 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
13 | class ApiCallLogger implements ApiCallLoggerInterface |
||
14 | { |
||
15 | protected const RESPONSE_DECISION = 'Decision'; |
||
16 | protected const RESPONSE_COMMUNICATION_TOKEN = 'CommunicationToken'; |
||
17 | |||
18 | /** |
||
19 | * @param string $orderReference |
||
20 | * @param string $type |
||
21 | * @param string $resultCode |
||
22 | * @param array $requestPayload |
||
23 | * @param \stdClass $responsePayload |
||
24 | * |
||
25 | * @return void |
||
26 | */ |
||
27 | public function log( |
||
28 | $orderReference, |
||
29 | $type, |
||
30 | $resultCode, |
||
31 | array $requestPayload, |
||
32 | stdClass $responsePayload |
||
33 | ) { |
||
34 | $callLog = new SpyArvatoRssApiCallLog(); |
||
35 | $callLog->setOrderReference($orderReference) |
||
36 | ->setCallType($type) |
||
37 | ->setResultCode($resultCode) |
||
38 | ->setRequestPayload( |
||
39 | print_r($requestPayload, true) |
||
40 | ) |
||
41 | ->setResponsePayload( |
||
42 | print_r($responsePayload, true) |
||
43 | ); |
||
44 | |||
45 | if ($this->isResponsePayloadCommunicationTokenExists($responsePayload)) { |
||
46 | $callLog->setCommunicationToken($responsePayload->Decision->CommunicationToken); |
||
47 | } |
||
48 | |||
49 | $callLog->save(); |
||
50 | } |
||
51 | |||
52 | /** |
||
53 | * @param \stdClass $responsePayload |
||
54 | * |
||
55 | * @return bool |
||
56 | */ |
||
57 | protected function isResponsePayloadCommunicationTokenExists(stdClass $responsePayload): bool |
||
61 | } |
||
62 | } |
||
63 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths