Passed
Push — master ( 6c42be...776013 )
by Igor
02:03
created

DynamicResponse   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 5
dl 0
loc 14
rs 10
c 0
b 0
f 0

1 Method

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