Skip to content

Commit 539f41b

Browse files
Merge pull request #910 from eliashaeussler/feature/typed-extconf
2 parents 867aa61 + f6e6e75 commit 539f41b

35 files changed

+861
-673
lines changed

Classes/Backend/ContextMenu/ItemProviders/CacheWarmupProvider.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public function __construct(
8787
protected function canRender(string $itemName, string $type): bool
8888
{
8989
// Early return if cache warmup from page tree is disabled globally
90-
if (!$this->configuration->isEnabledInPageTree()) {
90+
if (!$this->configuration->enabledInPageTree) {
9191
return false;
9292
}
9393

@@ -98,7 +98,7 @@ protected function canRender(string $itemName, string $type): bool
9898

9999
// Non-supported doktypes are never renderable
100100
$doktype = (int)($this->record['doktype'] ?? null);
101-
if ($doktype <= 0 || !\in_array($doktype, $this->configuration->getSupportedDoktypes(), true)) {
101+
if ($doktype <= 0 || !\in_array($doktype, $this->configuration->supportedDoktypes, true)) {
102102
return false;
103103
}
104104

Classes/Backend/ToolbarItems/CacheWarmupToolbarItem.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public function __construct(
9292
public function checkAccess(): bool
9393
{
9494
// Early return if cache warmup from backend toolbar is disabled globally
95-
if (!$this->configuration->isEnabledInToolbar()) {
95+
if (!$this->configuration->enabledInToolbar) {
9696
return false;
9797
}
9898

Classes/Command/WarmupCommand.php

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ protected function configure(): void
6868
$this->crawlingStrategyFactory->getAll(),
6969
));
7070

71-
$crawlingStrategy = $this->configuration->getStrategy();
71+
$crawlingStrategy = $this->configuration->crawlingStrategy;
7272
if ($crawlingStrategy !== null) {
7373
$crawlingStrategy = $crawlingStrategy::getName();
7474
}
@@ -140,7 +140,7 @@ protected function configure(): void
140140
├─ The maximum number of pages to be warmed up can be defined via the extension configuration <info>limit</info>.
141141
│ It can be overridden by using the <info>--limit</info> option.
142142
│ The value <info>0</info> deactivates the crawl limit.
143-
├─ Default: <info>{$v($this->configuration->getLimit())}</info>
143+
├─ Default: <info>{$v($this->configuration->limit)}</info>
144144
├─ Example: <comment>warming:cachewarmup -s 1 --limit 100</comment> (limits crawling to 100 pages)
145145
└─ Example: <comment>warming:cachewarmup -s 1 --limit 0</comment> (no limit)
146146
@@ -166,8 +166,8 @@ protected function configure(): void
166166
├─ Use the extension configuration <info>verboseCrawler</info> to use an alternative crawler for
167167
│ command-line requests. For warmup requests triggered via the TYPO3 backend, you can use the
168168
│ extension configuration <info>crawler</info>.
169-
├─ Currently used default crawler: <info>{$v($this->configuration->getCrawler()::class)}</info>
170-
└─ Currently used verbose crawler: <info>{$v($this->configuration->getVerboseCrawler()::class)}</info>
169+
├─ Currently used default crawler: <info>{$v($this->configuration->crawlerClass)}</info>
170+
└─ Currently used verbose crawler: <info>{$v($this->configuration->verboseCrawlerClass)}</info>
171171
172172
* <comment>Custom User-Agent header</comment>
173173
├─ When the default crawler is used, each warmup request is executed with a special User-Agent header.
@@ -206,7 +206,7 @@ protected function configure(): void
206206
null,
207207
Console\Input\InputOption::VALUE_REQUIRED,
208208
'Maximum number of pages to be crawled. Set to <info>0</info> to disable the limit.',
209-
$this->configuration->getLimit(),
209+
$this->configuration->limit,
210210
);
211211
$this->addOption(
212212
'strategy',
@@ -289,17 +289,16 @@ private function prepareCommandParameters(Console\Input\InputInterface $input):
289289
$format = $input->getOption('format');
290290

291291
// Fetch input options from extension configuration
292-
$excludePatterns = $this->configuration->getExcludePatterns();
293-
$crawler = $this->configuration->getVerboseCrawler();
294-
$crawlerOptions = $this->configuration->getVerboseCrawlerOptions();
295-
$parserOptions = $this->configuration->getParserOptions();
292+
$excludePatterns = $this->configuration->excludePatterns;
293+
$crawlerOptions = $this->configuration->verboseCrawlerOptions;
294+
$parserOptions = $this->configuration->parserOptions;
296295

297296
// Initialize sub-command parameters
298297
$subCommandParameters = [
299298
'sitemaps' => $sitemaps,
300299
'--urls' => $urls,
301300
'--limit' => $limit,
302-
'--crawler' => $crawler::class,
301+
'--crawler' => $this->configuration->verboseCrawlerClass,
303302
'--format' => $format,
304303
];
305304

0 commit comments

Comments
 (0)