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

eliashaeussler / typo3-solver / 8562357037

04 Apr 2024 10:58PM UTC coverage: 87.107%. Remained the same
8562357037

Pull #221

github

web-flow
[TASK] Update css-loader to v7

| datasource | package    | from   | to    |
| ---------- | ---------- | ------ | ----- |
| npm        | css-loader | 6.11.0 | 7.0.0 |
Pull Request #221: [TASK] Update css-loader to v7

858 of 985 relevant lines covered (87.11%)

6.71 hits per line

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

70.0
/Classes/Middleware/PingMiddleware.php
1
<?php
2

3
declare(strict_types=1);
4

5
/*
6
 * This file is part of the TYPO3 CMS extension "solver".
7
 *
8
 * Copyright (C) 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\Typo3Solver\Middleware;
25

26
use EliasHaeussler\Typo3Solver\Exception;
27
use EliasHaeussler\Typo3Solver\Http;
28
use EliasHaeussler\Typo3Solver\Utility;
29
use Psr\Http\Message;
30
use Psr\Http\Server;
31
use TYPO3\CMS\Core;
32

33
/**
34
 * PingMiddleware
35
 *
36
 * @author Elias Häußler <elias@haeussler.dev>
37
 * @license GPL-2.0-or-later
38
 */
39
final class PingMiddleware implements Server\MiddlewareInterface
40
{
41
    public const ROUTE_PATH = '/tx_solver/ping';
42

43
    /**
44
     * @throws Exception\EventStreamException
45
     */
46
    public function process(
4✔
47
        Message\ServerRequestInterface $request,
48
        Server\RequestHandlerInterface $handler,
49
    ): Message\ResponseInterface {
50
        // Pass through request if it's not supported
51
        if (!$this->isRequestSupported($request)) {
4✔
52
            return $handler->handle($request);
4✔
53
        }
54

55
        $eventStream = Http\EventStream::create();
×
56
        $eventStream->close();
×
57

58
        return new Core\Http\Response();
×
59
    }
60

61
    private function isRequestSupported(Message\ServerRequestInterface $request): bool
4✔
62
    {
63
        if ($request->getHeader('Accept') !== ['text/event-stream']) {
4✔
64
            return false;
2✔
65
        }
66

67
        return Utility\HttpUtility::uriMatchesRequest(self::ROUTE_PATH, $request);
2✔
68
    }
69
}
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