ResetServices::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 0
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 2
ccs 1
cts 1
cp 1
crap 1
rs 10
1
<?php
2
3
namespace Bdf\QueueBundle\Consumption\Receiver;
4
5
use Bdf\Queue\Consumer\ConsumerInterface;
6
use Bdf\Queue\Consumer\DelegateHelper;
7
use Bdf\Queue\Consumer\ReceiverInterface;
8
use Symfony\Component\HttpKernel\DependencyInjection\ServicesResetter;
9
10
/**
11
 * Reset all services registered on "kernel.reset".
12
 */
13
class ResetServices implements ReceiverInterface
14
{
15
    use DelegateHelper;
16
17 5
    public function __construct(private ServicesResetter $servicesResetter)
18
    {
19 5
    }
20
21 2
    public function receive($message, ConsumerInterface $next): void
22
    {
23
        try {
24 2
            $next->receive($message, $next);
0 ignored issues
show
Bug introduced by
The method receive() does not exist on Bdf\Queue\Consumer\ConsumerInterface. It seems like you code against a sub-type of Bdf\Queue\Consumer\ConsumerInterface such as Bdf\Queue\Consumer\Receiver\NextInterface. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

24
            $next->/** @scrutinizer ignore-call */ 
25
                   receive($message, $next);
Loading history...
25
        } finally {
26 2
            $this->servicesResetter->reset();
27
        }
28
    }
29
}
30