Passed
Branch master (d0211e)
by Willy
02:44
created

RewardItemService   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 35
ccs 0
cts 25
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
B prepareRewardItemValueObject() 0 27 2
1
<?php
2
3
namespace Kubinashi\BattlenetApi\WorldOfWarcraft\Shared\RewardItem\Service;
4
use Kubinashi\BattlenetApi\WorldOfWarcraft\Shared\RewardItem\Model\RewardItemValueObject;
5
6
/**
7
 * @author  Willy Reiche
8
 * @since   2017-12-06
9
 * @version 1.0
10
 */
11
class RewardItemService
12
{
13
    /**
14
     * @param \StdClass[] $rewardItems
15
     *
16
     * @return RewardItemValueObject[]
17
     */
18
    public function prepareRewardItemValueObject($rewardItems)
19
    {
20
        $rewardItemValueObjects = [];
21
22
        foreach ($rewardItems as $rewardItem) {
23
            $rewardItemValueObjects[] = new RewardItemValueObject(
24
                $rewardItem->id,
25
                $rewardItem->name,
26
                $rewardItem->icon,
27
                $rewardItem->quality,
28
                $rewardItem->itemLevel,
29
                $rewardItem->tooltipParams,
30
                $rewardItem->stats,
31
                $rewardItem->armor,
32
                $rewardItem->context,
33
                $rewardItem->bonusLists,
34
                $rewardItem->artifactId,
35
                $rewardItem->displayInfoId,
36
                $rewardItem->artifactAppearanceId,
37
                $rewardItem->artifactTraits,
38
                $rewardItem->relics,
39
                $rewardItem->appearance
40
            );
41
        }
42
43
        return $rewardItemValueObjects;
44
    }
45
}
46