Passed
Push — master ( 40654a...b847d6 )
by Michael
06:43 queued 10s
created

ModuleStats   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 16
rs 10
wmc 3

1 Method

Rating   Name   Duplication   Size   Complexity  
A getModuleStats() 0 9 3
1
<?php
2
3
namespace XoopsModules\Pedigree\Common;
4
5
/*
6
 You may not change or alter any portion of this comment or credits
7
 of supporting developers from this source code or any supporting source code
8
 which is considered copyrighted (c) material of the original comment or credit authors.
9
10
 This program is distributed in the hope that it will be useful,
11
 but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13
*/
14
15
/**
16
 * Feedback plugin for xoops modules
17
 *
18
 * @copyright      XOOPS Project  (https://xoops.org)
19
 * @license        GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
20
 * @author         Michael Beck <[email protected]>
21
 */
22
23
trait ModuleStats
24
{
25
    /**
26
     * @param \XoopsModules\Pedigree\Common\Configurator $configurator
27
     * @param array $moduleStats
28
     * @return array
29
     */
30
    public static function getModuleStats($configurator, $moduleStats)
31
    {
32
        if (count($configurator->moduleStats) > 0) {
0 ignored issues
show
Bug introduced by
The property moduleStats does not seem to exist on XoopsModules\Pedigree\Common\Configurator.
Loading history...
33
            foreach (array_keys($configurator->moduleStats) as $i) {
34
                $moduleStats[$i] = $configurator->moduleStats[$i];
35
            }
36
        }
37
38
        return $moduleStats;
39
    }
40
}
41