AchievementCriteriaChange   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
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