• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

visavi / rotor / 28340133337

28 Jun 2026 11:47PM UTC coverage: 16.561% (+0.09%) from 16.474%
28340133337

push

github

visavi
Ядро и модули переведены на datetime, удалена константа SITETIME

18 of 95 new or added lines in 31 files covered. (18.95%)

7 existing lines in 6 files now uncovered.

989 of 5972 relevant lines covered (16.56%)

2.44 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/app/Http/Controllers/CounterController.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace App\Http\Controllers;
6

7
use App\Models\Counter24;
8
use App\Models\Counter31;
9
use Illuminate\View\View;
10

11
class CounterController extends Controller
12
{
13
    /**
14
     * Главная страница
15
     */
16
    public function index(): View
×
17
    {
18
        $count = statsCounter();
×
19
        $online = statsOnline();
×
20

21
        $counts31 = [];
×
22
        $counters = Counter31::query()
×
23
            ->orderByDesc('period')
×
24
            ->limit(30)
×
25
            ->get()
×
26
            ->keyBy('period');
×
27

28
        for ($i = 0; $i < 30; $i++) {
×
NEW
29
            $curDate = now()->subDays($i)->format('Y-m-d 00:00:00');
×
30

31
            $cnt = $counters->get($curDate);
×
32

33
            $counts31['hits'][] = $cnt->hits ?? 0;
×
34
            $counts31['hosts'][] = $cnt->hosts ?? 0;
×
35
            $counts31['labels'][] = date('M j', strtotime($curDate));
×
36
        }
37

38
        $counts24 = [];
×
39
        $counters = Counter24::query()
×
40
            ->orderByDesc('period')
×
41
            ->limit(24)
×
42
            ->get()
×
43
            ->keyBy('period');
×
44

45
        for ($i = 0; $i < 24; $i++) {
×
NEW
46
            $curHour = now()->subHours($i)->format('Y-m-d H:00:00');
×
47

48
            $cnt = $counters->get($curHour);
×
49

50
            $counts24['hits'][] = $cnt->hits ?? 0;
×
51
            $counts24['hosts'][] = $cnt->hosts ?? 0;
×
52
            $counts24['labels'][] = date('H', strtotime($curHour));
×
53
        }
54

55
        return view('counters/index', compact('count', 'online', 'counts24', 'counts31'));
×
56
    }
57
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc