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

eliashaeussler / typo3-sitemap-locator / 11276770035

10 Oct 2024 03:04PM UTC coverage: 77.882% (-0.3%) from 78.193%
11276770035

Pull #75

github

web-flow
Merge b452a3828 into 485c64126
Pull Request #75: [FEATURE] Add support for TYPO3 v13.4 LTS

500 of 642 relevant lines covered (77.88%)

4.53 hits per line

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

71.43
/Classes/EventListener/SiteConfigurationListener.php
1
<?php
2

3
declare(strict_types=1);
4

5
/*
6
 * This file is part of the TYPO3 CMS extension "sitemap_locator".
7
 *
8
 * Copyright (C) 2023-2024 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\Typo3SitemapLocator\EventListener;
25

26
use EliasHaeussler\Typo3SitemapLocator\Cache;
27
use TYPO3\CMS\Core;
28

29
/**
30
 * SiteConfigurationListener
31
 *
32
 * @author Elias Häußler <elias@haeussler.dev>
33
 * @license GPL-2.0-or-later
34
 */
35
final class SiteConfigurationListener
36
{
37
    public function __construct(
2✔
38
        private readonly Cache\SitemapsCache $cache,
39
        private readonly Core\Site\SiteFinder $siteFinder,
40
    ) {}
2✔
41

42
    public function __invoke(Core\Configuration\Event\SiteConfigurationBeforeWriteEvent $event): void
2✔
43
    {
44
        try {
45
            $site = $this->siteFinder->getSiteByIdentifier($event->getSiteIdentifier());
2✔
46
        } catch (Core\Exception\SiteNotFoundException) {
×
47
            // Ignore new sites, they should not be cached anyway
48
            return;
×
49
        }
50

51
        $this->cache->remove($site);
2✔
52
    }
53
}
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