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

CPS-IT / personio-jobs / 15388375997

02 Jun 2025 09:09AM UTC coverage: 3.654% (+0.04%) from 3.61%
15388375997

push

github

web-flow
Merge pull request #228 from CPS-IT/task/drop-v11

[!!!][TASK] Drop support for TYPO3 v11.5

0 of 8 new or added lines in 5 files covered. (0.0%)

6 existing lines in 5 files now uncovered.

27 of 739 relevant lines covered (3.65%)

0.16 hits per line

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

0.0
/Classes/Cache/CacheManager.php
1
<?php
2

3
declare(strict_types=1);
4

5
/*
6
 * This file is part of the TYPO3 CMS extension "personio_jobs".
7
 *
8
 * Copyright (C) 2023 Elias Häußler <e.haeussler@familie-redlich.de>
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 CPSIT\Typo3PersonioJobs\Cache;
25

26
use CPSIT\Typo3PersonioJobs\Domain\Model\Job;
27
use Symfony\Component\DependencyInjection\Attribute\Autowire;
28
use TYPO3\CMS\Core\Cache\Frontend\FrontendInterface;
29
use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController;
30

31
/**
32
 * CacheManager
33
 *
34
 * @author Elias Häußler <e.haeussler@familie-redlich.de>
35
 * @license GPL-2.0-or-later
36
 */
37
final readonly class CacheManager
38
{
39
    public function __construct(
×
40
        #[Autowire(expression: 'service("TYPO3\\\\CMS\\\\Core\\\\Cache\\\\CacheManager").getCache("pages")')]
41
        private FrontendInterface $pageCache,
UNCOV
42
    ) {}
×
43

NEW
44
    public function addTag(?Job $job = null): void
×
45
    {
46
        $this->getTypoScriptFrontendController()?->addCacheTags([$this->buildCacheTag($job)]);
×
47
    }
48

NEW
49
    public function flushTag(?Job $job = null): void
×
50
    {
51
        $this->pageCache->flushByTag($this->buildCacheTag($job));
×
52
    }
53

NEW
54
    private function buildCacheTag(?Job $job = null): string
×
55
    {
56
        $cacheTag = 'tx_personiojobs';
×
57

58
        if ($job !== null) {
×
59
            $cacheTag .= '_' . $job->getUid();
×
60
        }
61

62
        return $cacheTag;
×
63
    }
64

65
    private function getTypoScriptFrontendController(): ?TypoScriptFrontendController
×
66
    {
67
        $tsfe = $GLOBALS['TSFE'] ?? null;
×
68

69
        if ($tsfe instanceof TypoScriptFrontendController) {
×
70
            return $tsfe;
×
71
        }
72

73
        return null;
×
74
    }
75
}
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