| Conditions | 5 |
| Paths | 7 |
| Total Lines | 19 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 9 |
| CRAP Score | 5 |
| Changes | 0 | ||
| 1 | <?php |
||
| 111 | protected function isPrimeNumber($number) { |
||
| 112 | $n = abs($number); |
||
| 113 | $i = 2; |
||
| 114 | |||
| 115 | if (10 < $number) { |
||
| 116 | if (in_array(substr($number, -1 ), array(0, 2, 4, 6, 8))) { |
||
| 117 | return FALSE; |
||
|
1 ignored issue
–
show
|
|||
| 118 | 2 | } |
|
| 119 | 2 | } |
|
| 120 | 2 | ||
| 121 | while ($i <= sqrt($n)) { |
||
| 122 | 2 | if ($n % $i == 0) { |
|
| 123 | 2 | return FALSE; |
|
|
1 ignored issue
–
show
|
|||
| 124 | 2 | } |
|
| 125 | $i++; |
||
| 126 | 2 | } |
|
| 127 | 2 | ||
| 128 | return TRUE; |
||
| 129 | 2 | } |
|
| 130 | |||
| 146 |