BaseResponse::__construct()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 7
rs 9.4286
cc 2
eloc 3
nc 2
nop 1
1
<?php
2
namespace Jleagle\BattleNet\Responses;
3
4
abstract class BaseResponse
5
{
6
  public function __construct(array $data)
7
  {
8
    foreach($data as $field => $value)
9
    {
10
      $this->$field = $value;
11
    }
12
  }
13
14
  public function toArray()
15
  {
16
    return get_object_vars($this);
17
  }
18
}
19