DynamicResponse   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 5
c 1
b 0
f 0
dl 0
loc 13
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A load() 0 8 2
1
<?php
2
3
/**
4
 * PHP version 5.4 and 8
5
 *
6
 * @category  ResponseEntity
7
 * @package   Payever\Core
8
 * @author    payever GmbH <[email protected]>
9
 * @copyright 2017-2021 payever GmbH
10
 * @license   MIT <https://opensource.org/licenses/MIT>
11
 * @link      https://docs.payever.org/shopsystems/api/getting-started
12
 */
13
14
namespace Payever\ExternalIntegration\Core\Http\ResponseEntity;
15
16
use Payever\ExternalIntegration\Core\Helper\StringHelper;
17
use Payever\ExternalIntegration\Core\Http\ResponseEntity;
18
19
/**
20
 * This class represents Dynamic ResponseInterface Entity
21
 * @SuppressWarnings(PHPMD.StaticAccess)
22
 */
23
class DynamicResponse extends ResponseEntity
24
{
25
    /**
26
     * {@inheritdoc}
27
     */
28
    public function load($data)
29
    {
30
        foreach ($data as $key => $value) {
31
            $property = StringHelper::camelize($key);
32
            $this->{$property} = $value;
33
        }
34
35
        return $this;
36
    }
37
}
38