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.
You have injected the Request via parameter $request. This is generally not recommended as there might be multiple instances during a request cycle (f.e. when using sub-requests). Instead, it is recommended to inject the RequestStack and retrieve the current request each time you need it via getCurrentRequest().
Loading history...
40
RequestIdProvider $fallback,
41
$headerName = RequestId::HEADER_NAME
42
) {
43
$this->headerName = $headerName;
44
$this->fallback = $fallback;
45
$this->request = $request;
46
}
47
48
/**
49
* @return string
50
*/
51
public function getRequestId()
52
{
53
if ($this->request->headers->has($this->headerName)) {
The expression $this->request->headers->get($this->headerName); of type string|array adds the type array to the return on line 54 which is incompatible with the return type declared by the interface Arki\RequestId\Providers...dProvider::getRequestId of type string|null.
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.