GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

ArmyLog::colorize()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 10
rs 9.4285
cc 2
eloc 7
nc 2
nop 1
1
<?php namespace Xaoc303\BattleCalc;
2
3
/**
4
 * Class ArmyLog
5
 * @package Xaoc303\BattleCalc
6
 */
7
class ArmyLog
8
{
9
    /**
10
     * colorize
11
     */
12
    public static function colorize(Army $army)
13
    {
14
        $units = $army->getUnits();
15
        $count = count($units);
16
        for ($i = 0; $i < $count; $i++) {
17
            self::colorize1($units, $i);
18
            self::colorize2($units, $i);
19
        }
20
        $army->setUnits($units);
21
    }
22
23
    /**
24
     * colorize1
25
     *
26
     * @param array $units
27
     * @param int $i
28
     */
29
    private static function colorize1(&$units, &$i) {
30
        if ($units[$i]['All']['AttackAir'] != 0 || $units[$i]['All']['AttackTer'] != 0) {
31
            $units[$i]['All']['Color'] = 1;
32
        }
33
    }
34
35
    /**
36
     * colorize2
37
     *
38
     * @param array $units
39
     * @param int $i
40
     */
41
    private static function colorize2(&$units, &$i) {
42
        for ($k = 0; $k < 3; $k++) {
43
            if ($units[$i]['All']['Magic'][$k] != null) {
44
                $units[$i]['All']['Color'] = 2;
45
            }
46
        }
47
    }
48
}
49