Passed
Pull Request — master (#20)
by
unknown
01:59
created

WarDetails   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 47
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 2
dl 0
loc 47
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 10 1
1
<?php
2
3
namespace PoLaKoSz\CoC_API\Models
4
{
5
    use PoLaKoSz\CoC_API\Helpers\TimeConverter;
6
    use PoLaKoSz\CoC_API\Models\WarDetailsClan;
7
8
    class WarDetails
9
    {
10
        /**
11
         * Value can be: warEnded / preparation /
12
         * 
13
         * @var string
14
         */
15
        public $state;
16
17
        /**
18
         * @var int
19
         */
20
        public $teamSize;
21
22
        /**
23
         * @var DateTime
24
         */
25
        public $preparationStartTime;
26
27
        /**
28
         * @var DateTime
29
         */
30
        public $startTime;
31
32
        /**
33
         * @var DateTime
34
         */
35
        public $endTime;
36
37
        public $clan;
38
39
        public $opponent;
40
41
        /**
42
         * @param stdClass
43
         */
44
        public function __construct($stdClass)
45
        {
46
            $this->state                = $stdClass->state;
47
            $this->teamSize             = $stdClass->teamSize;
48
            $this->preparationStartTime = TimeConverter::dateTimeConverter( $stdClass->preparationStartTime );
0 ignored issues
show
Documentation Bug introduced by
It seems like \PoLaKoSz\CoC_API\Helper...->preparationStartTime) of type object<DateTime> is incompatible with the declared type object<PoLaKoSz\CoC_API\Models\DateTime> of property $preparationStartTime.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
49
            $this->startTime            = TimeConverter::dateTimeConverter( $stdClass->startTime );
0 ignored issues
show
Documentation Bug introduced by
It seems like \PoLaKoSz\CoC_API\Helper...r($stdClass->startTime) of type object<DateTime> is incompatible with the declared type object<PoLaKoSz\CoC_API\Models\DateTime> of property $startTime.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
50
            $this->endTime              = TimeConverter::dateTimeConverter( $stdClass->endTime );
0 ignored issues
show
Documentation Bug introduced by
It seems like \PoLaKoSz\CoC_API\Helper...ter($stdClass->endTime) of type object<DateTime> is incompatible with the declared type object<PoLaKoSz\CoC_API\Models\DateTime> of property $endTime.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
51
            $this->clan                 = new WarDetailsClan( $stdClass->clan );
52
            $this->opponent             = new WarDetailsClan( $stdClass->opponent );
53
        }
54
    }
55
}