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...
20
{
21
/**
22
* @var ResponseContext
23
*/
24
private $responseContext;
25
26
/**
27
* @var mixed
28
*/
29
private $resource;
30
31
/**
32
* ResourceResponse constructor.
33
*
34
* @param mixed $resource
35
* @param ResponseContext $responseContext
36
*/
37
46
public function __construct($resource, ResponseContext $responseContext = null)
38
{
39
46
if (null === $responseContext) {
40
20
$responseContext = new ResponseContext();
41
}
42
43
46
$this->responseContext = $responseContext;
44
46
$this->resource = $resource;
45
46
}
46
47
/**
48
* {@inheritdoc}
49
*/
50
44
public function getResponseContext(): ResponseContext
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.