ModuleStats   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 18
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 (https://www.gnu.org/licenses/gpl-2.0.html)
20
 * @author         Michael Beck <[email protected]>
21
 */
22
trait ModuleStats
23
{
24
    /**
25
     *
26
     * @param \XoopsModules\Pedigree\Common\Configurator $configurator
27
     * @param array                                      $moduleStats
28
     *
29
     * @return array
30
     */
31
    public static function getModuleStats(Configurator $configurator, array $moduleStats): array
32
    {
33
        if (0 < \count($configurator->moduleStats)) {
34
            foreach (\array_keys($configurator->moduleStats) as $i) {
35
                $moduleStats[$i] = $configurator->moduleStats[$i];
36
            }
37
        }
38
39
        return $moduleStats;
40
    }
41
}
42