ProfileBadgeActivator::triggerMaxNrg()   A
last analyzed

Complexity

Conditions 3
Paths 4

Size

Total Lines 10
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 10
rs 9.4285
c 0
b 0
f 0
cc 3
eloc 5
nc 4
nop 1
1
<?php
2
class ProfileBadgeActivator extends BadgeActivator
3
{
4
    public function triggerMaxNrg($max)
5
    {
6
        if ($max >= 35) {
7
            $this->activate('max_nrg_35');
8
        }
9
10
        if ($max >= 100) {
11
            $this->activate('max_nrg_100');
12
        }
13
    }
14
15
    public function triggerSkill($max)
16
    {
17
        if ($max >= 35) {
18
            $this->activate('skill_35');
19
        }
20
21
        if ($max >= 100) {
22
            $this->activate('skill_100');
23
        }
24
    }
25
26
    public function triggerStrength($max)
27
    {
28
        if ($max >= 35) {
29
            $this->activate('strength_35');
30
        }
31
32
        if ($max >= 100) {
33
            $this->activate('strength_100');
34
        }
35
    }
36
37
    /**
38
     * @param integer $uid
39
     */
40
    public function triggerDollar($uid, $dollar)
41
    {
42
        $this->setUid($uid);
43
        if ($dollar >= 50) {
44
            $this->activate('dollar_50');
45
        }
46
        if ($dollar >= 5000) {
47
            $this->activate('dollar_5000');
48
        }
49
    }
50
51
    /**
52
     * @param integer $uid
53
     * @param integer $level
54
     */
55
    public function triggerLevel($uid, $level)
56
    {
57
        $this->setUid($uid);
58
        if ($level >= 10) {
59
            $this->activate('level_10');
60
        }
61
        if ($level >= 100) {
62
            $this->activate('level_100');
63
        }
64
    }
65
}
0 ignored issues
show
Coding Style introduced by
As per coding style, files should not end with a newline character.

This check marks files that end in a newline character, i.e. an empy line.

Loading history...
66