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.
Completed
Push — master ( 6fcb7a...fcde01 )
by t
06:59 queued 04:42
created

GMAT::gcd()   B

Complexity

Conditions 7
Paths 16

Size

Total Lines 20
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 56

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 7
eloc 13
c 1
b 0
f 0
nc 16
nop 1
dl 0
loc 20
ccs 0
cts 14
cp 0
crap 56
rs 8.8333
1
<?php
2
/**
3
 * Trait MathAndTrigonometry-G
4
 *
5
 * @link https://www.icy2003.com/
6
 * @author icy2003 <[email protected]>
7
 * @copyright Copyright (c) 2017, icy2003
8
 */
9
namespace icy2003\php\icomponents\excel\mathAndTrigonometry;
10
11
/**
12
 * MathAndTrigonometry-G
13
 */
14
trait GMAT
15
{
16
    /**
17
     * 返回两个或多个整数的最大公约数。 最大公约数是能够同时整除 number1 和 number2 而没有余数的最大整数
18
     *
19
     * @param integer|array $number1 Number1 是必需的,后续数字是可选的。 介于 1 和 255 之间的值
20
     *
21
     * @return integer
22
     */
23
    public static function gcd($number1)
24
    {
25
        $numbers = is_array($number1) ? $number1 : func_get_args();
26
        $n = min($numbers);
27
        if (in_array(0, $numbers)) {
28
            return max($numbers);
29
        }
30
        for ($i = $n; $i > 1; $i--) {
31
            $isFind = true;
32
            foreach ($numbers as $num) {
33
                if (false === is_int($num / $i)) {
34
                    $isFind = false;
35
                    break;
36
                }
37
            }
38
            if (true === $isFind) {
39
                return $i;
40
            }
41
        }
42
        return 1;
43
    }
44
}
45