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

api-platform / core / 5645455322

pending completion
5645455322

push

github

web-flow
test: fix a bug in DummyDtoInputOutputProvider (#5694)

10875 of 18245 relevant lines covered (59.61%)

20.04 hits per line

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

0.0
/src/Symfony/EventListener/ErrorListener.php
1
<?php
2

3
/*
4
 * This file is part of the API Platform project.
5
 *
6
 * (c) Kévin Dunglas <dunglas@gmail.com>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11

12
declare(strict_types=1);
13

14
namespace ApiPlatform\Symfony\EventListener;
15

16
use ApiPlatform\Action\ExceptionAction;
17
use Symfony\Component\HttpFoundation\Request;
18
use Symfony\Component\HttpKernel\EventListener\ErrorListener as SymfonyErrorListener;
19

20
/**
21
 * This error listener extends the Symfony one in order to add
22
 * the `_api_operation` attribute when the request is duplicated.
23
 * It will later be used to retrieve the exceptionToStatus from the operation ({@see ExceptionAction}).
24
 */
25
final class ErrorListener extends SymfonyErrorListener
26
{
27
    protected function duplicateRequest(\Throwable $exception, Request $request): Request
28
    {
29
        $dup = parent::duplicateRequest($exception, $request);
×
30

31
        if ($request->attributes->has('_api_operation')) {
×
32
            $dup->attributes->set('_api_operation', $request->attributes->get('_api_operation'));
×
33
        }
34

35
        return $dup;
×
36
    }
37
}
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