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

eliashaeussler / typo3-warming / 19411815683

16 Nov 2025 08:47PM UTC coverage: 94.058% (+1.1%) from 93.007%
19411815683

Pull #1018

github

eliashaeussler
[!!!][TASK] Drop support for TYPO3 v12.4
Pull Request #1018: [!!!][TASK] Drop support for TYPO3 v12.4

23 of 23 new or added lines in 9 files covered. (100.0%)

11 existing lines in 1 file now uncovered.

1678 of 1784 relevant lines covered (94.06%)

12.21 hits per line

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

47.62
/Classes/Configuration/Configuration.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\Configuration;
25

26
use EliasHaeussler\CacheWarmup;
27
use EliasHaeussler\Typo3Warming\Crawler;
28
use EliasHaeussler\Typo3Warming\Extension;
29
use EliasHaeussler\Typo3Warming\Http;
30
use mteu\TypedExtConf;
31
use TYPO3\CMS\Core;
32

33
/**
34
 * Configuration
35
 *
36
 * @author Elias Häußler <elias@haeussler.dev>
37
 * @license GPL-2.0-or-later
38
 */
39
#[TypedExtConf\Attribute\ExtensionConfig(extensionKey: Extension::KEY)]
40
final class Configuration
41
{
42
    private ?CacheWarmup\Crawler\CrawlerFactory $crawlerFactory = null;
43

44
    /**
45
     * @param class-string<CacheWarmup\Crawler\Crawler> $crawlerClass
46
     * @param array<string, mixed> $crawlerOptions
47
     * @param class-string<CacheWarmup\Crawler\VerboseCrawler> $verboseCrawlerClass
48
     * @param array<string, mixed> $verboseCrawlerOptions
49
     * @param array<string, mixed> $parserOptions
50
     * @param array<string, mixed> $clientOptions
51
     * @param non-negative-int $limit
52
     * @param list<non-empty-string> $excludePatterns
53
     * @param list<int> $supportedDoktypes
54
     */
55
    public function __construct(
41✔
56
        #[TypedExtConf\Attribute\ExtConfProperty(path: 'crawler')]
57
        public readonly string $crawlerClass = Crawler\ConcurrentUserAgentCrawler::class,
58
        #[TypedExtConf\Attribute\ExtConfProperty]
59
        public readonly array $crawlerOptions = [],
60
        #[TypedExtConf\Attribute\ExtConfProperty(path: 'verboseCrawler')]
61
        public readonly string $verboseCrawlerClass = Crawler\OutputtingUserAgentCrawler::class,
62
        #[TypedExtConf\Attribute\ExtConfProperty]
63
        public readonly array $verboseCrawlerOptions = [],
64
        #[TypedExtConf\Attribute\ExtConfProperty]
65
        public readonly array $parserOptions = [],
66
        #[TypedExtConf\Attribute\ExtConfProperty]
67
        public readonly array $clientOptions = [],
68
        #[TypedExtConf\Attribute\ExtConfProperty]
69
        public readonly int $limit = 250,
70
        #[TypedExtConf\Attribute\ExtConfProperty(path: 'exclude')]
71
        public readonly array $excludePatterns = [],
72
        #[TypedExtConf\Attribute\ExtConfProperty(path: 'strategy')]
73
        public readonly ?CacheWarmup\Crawler\Strategy\CrawlingStrategy $crawlingStrategy = null,
74
        #[TypedExtConf\Attribute\ExtConfProperty(path: 'enablePageTree')]
75
        public readonly bool $enabledInPageTree = true,
76
        #[TypedExtConf\Attribute\ExtConfProperty]
77
        public readonly array $supportedDoktypes = [Core\Domain\Repository\PageRepository::DOKTYPE_DEFAULT],
78
        #[TypedExtConf\Attribute\ExtConfProperty(path: 'enableToolbar')]
79
        public readonly bool $enabledInToolbar = true,
80
    ) {}
41✔
81

82
    /**
83
     * @throws CacheWarmup\Exception\CrawlerDoesNotExist
84
     * @throws CacheWarmup\Exception\CrawlerIsInvalid
85
     */
86
    public function getCrawler(): CacheWarmup\Crawler\Crawler
10✔
87
    {
88
        return $this->getCrawlerFactory()->get($this->crawlerClass, $this->crawlerOptions);
10✔
89
    }
90

91
    /**
92
     * @throws CacheWarmup\Exception\CrawlerDoesNotExist
93
     * @throws CacheWarmup\Exception\CrawlerIsInvalid
94
     */
95
    public function getVerboseCrawler(): CacheWarmup\Crawler\VerboseCrawler
1✔
96
    {
97
        return $this->getCrawlerFactory()->get($this->verboseCrawlerClass, $this->verboseCrawlerOptions);
1✔
98
    }
99

100
    /**
101
     * @deprecated Use {@see RequestOptions::getUserAgent()} instead. Will be removed in v5.0.
102
     */
UNCOV
103
    public function getUserAgent(): string
×
104
    {
UNCOV
105
        trigger_error(
×
UNCOV
106
            \sprintf(
×
UNCOV
107
                'Method "%s()" is deprecated and will be removed in v5.0. ' .
×
UNCOV
108
                'Access User-Agent header via "%s::getUserAgent()" method instead.',
×
UNCOV
109
                __METHOD__,
×
UNCOV
110
                Http\Message\Request\RequestOptions::class,
×
UNCOV
111
            ),
×
UNCOV
112
            E_USER_DEPRECATED,
×
UNCOV
113
        );
×
114

UNCOV
115
        return (new Http\Message\Request\RequestOptions())->getUserAgent();
×
116
    }
117

118
    private function getCrawlerFactory(): CacheWarmup\Crawler\CrawlerFactory
11✔
119
    {
120
        return $this->crawlerFactory ??= Core\Utility\GeneralUtility::makeInstance(
11✔
121
            CacheWarmup\Crawler\CrawlerFactory::class,
11✔
122
        );
11✔
123
    }
124
}
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