Completed
Pull Request — master (#7)
by Julien
03:18
created

MergeRequest::getPostURL()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
c 0
b 0
f 0
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace TheCodingMachine\Gotenberg;
4
5
final class MergeRequest extends Request implements GotenbergRequestInterface
6
{
7
    /** @var Document[] */
8
    private $files;
9
10
    /**
11
     * OfficeRequest constructor.
12
     * @param Document[] $files
13
     */
14
    public function __construct(array $files)
15
    {
16
        $this->files = $files;
17
    }
18
19
20
    /**
21
     * @return string
22
     */
23
    public function getPostURL(): string
24
    {
25
        return '/convert/merge';
26
    }
27
28
    /**
29
     * @return array<string,Document>
30
     */
31
    public function getFormFiles(): array
32
    {
33
        $files = [];
34
        foreach ($this->files as $file) {
35
            $files[$file->getFileName()] = $file;
36
        }
37
        return $files;
38
    }
39
}
40