BaseResponse::toArray()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
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