ClubCompetitor::getLootDollar()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
/**
3
 * @property integer $lootDollar
4
 */
5
class ClubCompetitor extends Competitor
6
{
7
    protected $lootDollar = 0;
8
9
    public function getLootDollar()
10
    {
11
        return $this->lootDollar;
12
    }
13
14
    protected function updateAttributes($player)
15
    {
16
        parent::updateAttributes($player);
17
        
18
        //put back loot (for view)
19
        $this->awardDollar = $this->lootDollar;
20
    }
21
    protected function winPrize()
22
    {
23
        parent::winPrize();
24
25
        if (!$this->opponent['energy']) {
26
            $this->awardDollar = 0;
27
        }
28
29
        //add to loot, instead of player
30
        $this->lootDollar = $this->awardDollar;
0 ignored issues
show
Coding Style introduced by
Equals sign not aligned with surrounding assignments; expected 2 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
31
        $this->awardDollar = 0;
32
    }
33
    
34
    protected function losePrize()
35
    {
36
        parent::losePrize();
37
38
        if (!$this->isCaller) {
39
            if (!$this->energy) {
40
                $this->reqDollar = 0;
41
            }
42
        }
43
    }
44
}
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...
45