Passed
Pull Request — master (#19)
by
unknown
01:50
created

LegendStatistics::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 5
nc 1
nop 1
1
<?php
2
3
namespace ClashApi\Models
4
{
5
    use ClashApi\Models\LegendLeagueTournamentSeasonResult;
6
    
7
    class LegendStatistics
8
    {
9
        public $legendTrophies;
10
11
        /**
12
         * @var LegendLeagueTournamentSeasonResult
13
         */
14
        public $currentSeason;
15
16
        /**
17
         * @var LegendLeagueTournamentSeasonResult
18
         */
19
        public $previousSeason;
20
21
        /**
22
         * @var LegendLeagueTournamentSeasonResult
23
         */
24
        public $bestSeason;
25
26
        /**
27
         * @param stdClass
28
         */
29
        public function __construct($stdClass)
30
        {
31
            $this->legendTrophies = $stdClass->legendTrophies;
32
            $this->currentSeason  = new LegendLeagueTournamentSeasonResult($stdClass->currentSeason);
33
            $this->previousSeason = new LegendLeagueTournamentSeasonResult($stdClass->previousSeason);
34
            $this->bestSeason     = new LegendLeagueTournamentSeasonResult($stdClass->bestSeason);
35
        }
36
    }
37
}