Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
70.00% |
7 / 10 |
|
50.00% |
3 / 6 |
CRAP | |
0.00% |
0 / 1 |
FileRelation | |
70.00% |
7 / 10 |
|
50.00% |
3 / 6 |
6.97 | |
0.00% |
0 / 1 |
__construct | |
100.00% |
5 / 5 |
|
100.00% |
1 / 1 |
1 | |||
getTargetType | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getTargetName | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
getRelationshipType | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getTarget | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getTargetId | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | declare(strict_types=1); |
3 | |
4 | class FileRelation extends DataCollectionTypeSafe { |
5 | |
6 | protected string $targetType = ''; |
7 | protected string $targetName = ''; |
8 | protected FileRelationshipType $relationshipType = FileRelationshipType::unknown; |
9 | protected ?File $target; |
10 | protected ?string $targetId; |
11 | |
12 | public function __construct( |
13 | string $targetType, |
14 | string $targetName, |
15 | FileRelationshipType $relationshipType = FileRelationshipType::unknown, |
16 | File $target = null, |
17 | string $targetId = null, |
18 | ) { |
19 | $this->targetType = $targetType; |
20 | $this->targetName = $targetName; |
21 | $this->relationshipType = $relationshipType; |
22 | $this->target = $target; |
23 | $this->targetId = $targetId; |
24 | } |
25 | |
26 | |
27 | public function getTargetType(): string { |
28 | |
29 | return $this->targetType; |
30 | } |
31 | |
32 | |
33 | public function getTargetName(): string { |
34 | |
35 | return $this->targetName; |
36 | } |
37 | |
38 | |
39 | public function getRelationshipType(): FileRelationshipType { |
40 | |
41 | return $this->relationshipType; |
42 | } |
43 | |
44 | |
45 | public function getTarget(): ?File { |
46 | |
47 | return $this->target; |
48 | } |
49 | |
50 | |
51 | public function getTargetId(): ?string { |
52 | |
53 | return $this->targetId; |
54 | } |
55 | } |