b_waiting_yomi()   A
last analyzed

Complexity

Conditions 3
Paths 4

Size

Total Lines 26
Code Lines 17

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 1 Features 0
Metric Value
cc 3
eloc 17
nc 4
nop 0
dl 0
loc 26
rs 9.7
c 2
b 1
f 0
1
<?php declare(strict_types=1);
2
3
/**
4
 * @return array
5
 */
6
function b_waiting_yomi()
7
{
8
    $log_path      = XOOPS_ROOT_PATH . '/modules/yomi/log/';
9
    $log_file      = 'ys4_temp.cgi';
10
    $lang_linkname = 'Yomi';
0 ignored issues
show
Unused Code introduced by
The assignment to $lang_linkname is dead and can be removed.
Loading history...
11
    $ret           = [];
12
    $block         = [];
13
    $cTemp         = 0;
14
    $fp            = fopen("{$log_path}{$log_file}", 'rb');
15
16
    while ($tmp = fgets($fp, 4096)) {
0 ignored issues
show
Unused Code introduced by
The assignment to $tmp is dead and can be removed.
Loading history...
17
        ++$cTemp;
18
    }
19
    fclose($fp);
20
21
    if (0 !== $cTemp) {
22
        $block = [
23
            'adminlink'     => XOOPS_URL . '/modules/yomi/admin.php',
24
            'pendingnum'    => $cTemp,
25
            'lang_linkname' => _PI_WAITING_WAITINGS,
26
        ];
27
    }
28
29
    $ret[] = $block;
30
31
    return $ret;
32
}
33