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

eliashaeussler / typo3-warming / 19478394456

18 Nov 2025 07:18PM UTC coverage: 94.592% (-0.05%) from 94.642%
19478394456

push

github

web-flow
Merge pull request #1029 from eliashaeussler/fix/log

1 of 2 new or added lines in 1 file covered. (50.0%)

1679 of 1775 relevant lines covered (94.59%)

12.27 hits per line

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

91.67
/Classes/UserFunc/LogTableFormatter.php
1
<?php
2

3
declare(strict_types=1);
4

5
/*
6
 * This file is part of the TYPO3 CMS extension "warming".
7
 *
8
 * Copyright (C) 2021-2025 Elias Häußler <elias@haeussler.dev>
9
 *
10
 * This program is free software: you can redistribute it and/or modify
11
 * it under the terms of the GNU General Public License as published by
12
 * the Free Software Foundation, either version 2 of the License, or
13
 * (at your option) any later version.
14
 *
15
 * This program is distributed in the hope that it will be useful,
16
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
 * GNU General Public License for more details.
19
 *
20
 * You should have received a copy of the GNU General Public License
21
 * along with this program. If not, see <https://www.gnu.org/licenses/>.
22
 */
23

24
namespace EliasHaeussler\Typo3Warming\UserFunc;
25

26
use EliasHaeussler\Typo3Warming\Domain;
27
use TYPO3\CMS\Backend;
28

29
/**
30
 * LogTableFormatter
31
 *
32
 * @author Elias Häußler <elias@haeussler.dev>
33
 * @license GPL-2.0-or-later
34
 * @internal
35
 */
36
final class LogTableFormatter
37
{
38
    private const TEMPLATE = '[%s] @ %s > %s';
39

40
    /**
41
     * @param array{row: array{uid?: int}} $parameters
42
     */
43
    public function formatTitle(array &$parameters): void
1✔
44
    {
45
        if (!isset($parameters['row']['uid'])) {
1✔
NEW
46
            return;
×
47
        }
48

49
        /** @var array{request_id: string, date: int, url: string}|null $record */
50
        $record = Backend\Utility\BackendUtility::getRecord(Domain\Model\Log::TABLE_NAME, $parameters['row']['uid']);
1✔
51

52
        if ($record !== null) {
1✔
53
            $date = \DateTimeImmutable::createFromFormat('U', (string)$record['date']);
1✔
54
            $parameters['title'] = sprintf(
1✔
55
                self::TEMPLATE,
1✔
56
                $record['request_id'],
1✔
57
                $date !== false ? $date->format('d.m.Y H:i:s') : '(unknown)',
1✔
58
                $record['url'],
1✔
59
            );
1✔
60
        }
61
    }
62
}
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

© 2025 Coveralls, Inc