ReportGenerator   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 5
lcom 0
cbo 0
dl 0
loc 30
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A generateReport() 0 22 5
1
<?php
2
declare(strict_types=1);
3
4
/**
5
 * File: ReportGenerator.php
6
 *
7
 * @author      Maciej Sławik <[email protected]>
8
 * Github:      https://github.com/maciejslawik
9
 */
10
11
namespace MSlwk\ReactPhpPlayground\Model\Report;
12
13
use MSlwk\ReactPhpPlayground\Api\Report\ReportGeneratorInterface;
14
15
/**
16
 * Class ReportGenerator
17
 * @package MSlwk\ReactPhpPlayground\Model\Report
18
 */
19
class ReportGenerator implements ReportGeneratorInterface
20
{
21
    /**
22
     * @param int $customerId
23
     * @return string
24
     * @codeCoverageIgnore
25
     */
26
    public function generateReport(int $customerId): string
27
    {
28
        /**
29
         * Report is being generated
30
         */
31
        $loopSize = 31500;
32
33
        $primes = [];
34
35
        for ($i = 2; $i < $loopSize; $i++) {
36
            for ($j = 2; $j < $i; $j++) {
37
                if ($i % $j == 0) {
38
                    break;
39
                }
40
            }
41
            if ($i === $j) {
42
                $primes[] = $i;
43
            }
44
        }
45
46
        return '';
47
    }
48
}
49