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

eliashaeussler / typo3-warming / 12587343620

02 Jan 2025 06:59PM UTC coverage: 90.268%. First build
12587343620

Pull #769

github

web-flow
Merge dfcf7a38c into 4c89ccdb8
Pull Request #769: [!!!][FEATURE] Require `eliashaeussler/cache-warmup` ^4.0

69 of 81 new or added lines in 11 files covered. (85.19%)

1076 of 1192 relevant lines covered (90.27%)

8.43 hits per line

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

0.0
/Classes/EventListener/ClientOptionsListener.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\EventListener;
25

26
use EliasHaeussler\CacheWarmup;
27
use EliasHaeussler\Typo3Warming\Http;
28
use TYPO3\CMS\Core;
29

30
/**
31
 * ClientOptionsListener
32
 *
33
 * @author Elias Häußler <elias@haeussler.dev>
34
 * @license GPL-2.0-or-later
35
 * @internal
36
 */
37
final class ClientOptionsListener
38
{
39
    public function __construct(
×
40
        private readonly Http\Client\ClientBridge $clientBridge,
41
    ) {}
×
42

43
    // @todo Enable attribute once support for TYPO3 v12 is dropped
44
    // #[\TYPO3\CMS\Core\Attribute\AsEventListener('eliashaeussler/typo3-warming/client-options')]
NEW
45
    public function __invoke(CacheWarmup\Event\Config\ConfigResolved $event): void
×
46
    {
NEW
47
        $clientOptions = $event->config()->getClientOptions();
×
NEW
48
        $config = $this->clientBridge->getClientConfig();
×
49

50
        // Overwrite handler if not exists yet
NEW
51
        if (!isset($clientOptions['handler']) && isset($config['handler'])) {
×
NEW
52
            $clientOptions['handler'] = $config['handler'];
×
NEW
53
            unset($config['handler']);
×
54
        }
55

NEW
56
        Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($clientOptions, $config);
×
57

NEW
58
        $event->config()->setClientOptions($clientOptions);
×
59
    }
60
}
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