AchievementCriteriaChange::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 3
1
<?php
2
3
namespace Zurbaev\Achievements;
4
5
class AchievementCriteriaChange
6
{
7
    const PROGRESS_ACCUMULATE = 'accumulate';
8
    const PROGRESS_SET = 'set';
9
    const PROGRESS_HIGHEST = 'highest';
10
11
    /**
12
     * @var int
13
     */
14
    public $value = 0;
15
16
    /**
17
     * @var string
18
     */
19
    public $progressType = '';
20
21
    /**
22
     * @var array
23
     */
24
    public $progressData = [];
25
26
    /**
27
     * AchievementCriteriaChange constructor.
28
     *
29
     * @param int         $value
30
     * @param string|null $progressType
31
     * @param array       $progressData = []
32
     */
33
    public function __construct(int $value, string $progressType = null, array $progressData = [])
34
    {
35
        $this->value = $value;
36
        $this->progressType = $progressType ?? static::PROGRESS_ACCUMULATE;
37
        $this->progressData = $progressData;
38
    }
39
}
40