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...
17
{
18
use IdentifierCollectionContainer;
19
20
/**
21
* IdentifierCollectionRelationship constructor.
22
*
23
* @param array $metadata
24
*/
25
21
public function __construct(array $metadata = [])
26
{
27
21
$this->metadata = $metadata;
28
21
}
29
30
/**
31
* {@inheritdoc}
32
*/
33
3
public function toArray(): array
34
{
35
3
$data = parent::toArray();
36
37
3
$data['data'] = $this->identifiersToArray();
38
39
3
return $data;
40
}
41
42
/**
43
* Cast to a string
44
*
45
* @return string
46
*/
47
7
public function __toString(): string
48
{
49
7
return 'Relationship contains a collection of resource-identifiers';
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.