Passed
Push — master ( 37e99a...e89913 )
by Ruben
01:57
created

src/Statistics.php (1 issue)

Severity
1
<?php
2
/**
3
 *
4
 * (c) Ruben Dorado <[email protected]>
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
namespace SiteAnalyzer;
10
11
12
/**
13
 * class Statistics
14
 *
15
 * @package   SiteAnalyzer
16
 * @author    Ruben Dorado <[email protected]>
17
 * @copyright 2018 Ruben Dorado
18
 * @license   http://www.opensource.org/licenses/MIT The MIT License
19
 */
20
class Statistics
21
{
22
    
23
    /*
24
     * @param
25
     */
26
    public static function ABtest($testCounts, $targetCounts, $options)
0 ignored issues
show
The parameter $options is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

26
    public static function ABtest($testCounts, $targetCounts, /** @scrutinizer ignore-unused */ $options)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
27
    {
28
        $ntotal = 0;
29
        $resp  = [];
30
        foreach($testCounts as $testCount) {
31
            $ntotal += $testCount[1];
32
        }
33
        foreach($testCounts as $testCount) {
34
            foreach ($targetCounts as $targetCount) {
35
                if ($testCount[0] === $targetCount[1]) {
36
                    $resp[] = [$testCount[0], $testCount[1], $testCount[1]/$ntotal, $targetCount[2], $targetCount[2]/$testCount[1],$targetCount[2]/$ntotal];
37
                }                
38
            }
39
            
40
        }
41
        return $resp;
42
    }
43
    
44
}
45