| Total Complexity | 2 |
| Total Lines | 37 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 2 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 8 | trait TransformsAttachments |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * @param string $attachmentUrl |
||
| 12 | * @return array |
||
| 13 | */ |
||
| 14 | 1 | protected function toDevOpsAttachment(string $attachmentUrl): array |
|
| 15 | { |
||
| 16 | 1 | return [ |
|
| 17 | 1 | [ |
|
| 18 | 1 | 'op' => 'add', |
|
| 19 | 1 | 'path' => '/relations/-', |
|
| 20 | 1 | 'value' => [ |
|
| 21 | 1 | 'rel' => 'AttachedFile', |
|
| 22 | 1 | 'url' => $attachmentUrl, |
|
| 23 | 1 | 'attributes' => [ |
|
| 24 | 1 | 'comment' => '', |
|
| 25 | 1 | ], |
|
| 26 | 1 | ], |
|
| 27 | 1 | ], |
|
| 28 | 1 | ]; |
|
| 29 | } |
||
| 30 | |||
| 31 | /** |
||
| 32 | * @param array $attachment |
||
| 33 | * |
||
| 34 | * @throws \TestMonitor\DevOps\Exceptions\InvalidDataException |
||
| 35 | * |
||
| 36 | * @return \TestMonitor\DevOps\Resources\Attachment |
||
| 37 | */ |
||
| 38 | 1 | protected function fromDevOpsAttachment(array $attachment): Attachment |
|
| 45 | 1 | ]); |
|
| 46 | } |
||
| 48 |