ReportGenerator::generateReport()   A
last analyzed

Complexity

Conditions 5
Paths 7

Size

Total Lines 22

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 22
rs 9.2568
c 0
b 0
f 0
cc 5
nc 7
nop 1
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