| Conditions | 3 |
| Paths | 3 |
| Total Lines | 22 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 17 |
| CRAP Score | 3 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 19 | 1 | public function prepareHunterPets(\StdClass $responseObject) |
|
| 20 | { |
||
| 21 | 1 | $hunterPets = []; |
|
| 22 | 1 | foreach ($responseObject->hunterPets as $hunterPet) { |
|
| 23 | 1 | $hunterPetSpecValueObject = null; |
|
| 24 | 1 | if (isset($hunterPet->spec)) { |
|
| 25 | 1 | $hunterPetSpecValueObject = $this->prepareHunterPetSpecValueObject($hunterPet->spec); |
|
| 26 | 1 | } |
|
| 27 | |||
| 28 | 1 | $hunterPets[] = new HunterPetValueObject( |
|
| 29 | 1 | $hunterPet->name, |
|
| 30 | 1 | $hunterPet->creature, |
|
| 31 | 1 | $hunterPet->slot, |
|
| 32 | 1 | $hunterPet->calcSpec, |
|
| 33 | 1 | $hunterPet->familyId, |
|
| 34 | 1 | $hunterPet->familyName, |
|
| 35 | $hunterPetSpecValueObject |
||
| 36 | 1 | ); |
|
| 37 | 1 | } |
|
| 38 | |||
| 39 | 1 | return $hunterPets; |
|
| 40 | } |
||
| 41 | |||
| 58 |