RetrieveApiCallResponse::setCall()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
nc 1
nop 1
1
<?php
2
3
/**
4
 * PHP version 5.4 and 8
5
 *
6
 * @category  ResponseEntity
7
 * @package   Payever\Payments
8
 * @author    payever GmbH <[email protected]>
9
 * @author    Andrey Puhovsky <[email protected]>
10
 * @copyright 2017-2021 payever GmbH
11
 * @license   MIT <https://opensource.org/licenses/MIT>
12
 * @link      https://docs.payever.org/shopsystems/api/getting-started
13
 */
14
15
namespace Payever\ExternalIntegration\Payments\Http\ResponseEntity;
16
17
use Payever\ExternalIntegration\Core\Http\MessageEntity\DynamicEntity;
18
use Payever\ExternalIntegration\Core\Http\ResponseEntity;
19
20
/**
21
 * This class represents Retrieve Api Call Entity
22
 */
23
class RetrieveApiCallResponse extends ResponseEntity
24
{
25
    /**
26
     * {@inheritdoc}
27
     */
28
    public function load($data)
29
    {
30
        if (!is_array($data) || !isset($data['call'])) {
31
            $data = ['call' => $data];
32
        }
33
34
        return parent::load($data);
35
    }
36
37
    /**
38
     * {@inheritdoc}
39
     */
40
    public function setCall($call)
41
    {
42
        $this->call = new DynamicEntity($call);
43
    }
44
}
45