This class seems to be duplicated in your project.
Duplicated code is one of the most pungent code smells. If you need to duplicate
the same code in three or more different places, we strongly encourage you to
look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.
Loading history...
22
{
23
/**
24
* @var RequestInterface
25
*/
26
private $request;
27
/**
28
* @var RequestIdGenerator
29
*/
30
private $generator;
31
32
/**
33
* @param RequestIdGenerator $generator
34
*/
35
public function __construct(RequestIdGenerator $generator)
36
{
37
$this->generator = $generator;
38
}
39
40
/**
41
* @return RequestIdProvider
42
*/
43
public function create()
44
{
45
return new ExtractsRequestIdFromHeader($this->request, new DefaultRequestIdProvider($this->generator));
46
}
47
48
/**
49
* @param RequestInterface $request
50
*/
51
public function setRequest($request)
52
{
53
if (!$request instanceof RequestInterface) {
54
throw new \InvalidArgumentException('Invalid argument received. Expected: '.RequestInterface::class);
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.