Completed
Push — master ( cdcbf9...7e5724 )
by Julien
05:30
created

MarkdownRequest::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 MarkdownRequest extends HTMLRequest
6
{
7
    /** @var Document[] */
8
    private $markdowns;
9
10
    /**
11
     * MarkdownRequest constructor.
12
     * @param Document $index
13
     * @param Document[] $markdowns
14
     */
15
    public function __construct(Document $index, array $markdowns)
16
    {
17
        parent::__construct($index);
18
        $this->markdowns = $markdowns;
19
    }
20
21
22
    /**
23
     * @return string
24
     */
25
    public function getPostURL(): string
26
    {
27
        return '/convert/markdown';
28
    }
29
30
    /**
31
     * @return array<string,Document>
32
     */
33
    public function getFormFiles(): array
34
    {
35
        $files = parent::getFormFiles();
36
        foreach ($this->markdowns as $markdown) {
37
            $files[$markdown->getFileName()] = $markdown;
38
        }
39
        return $files;
40
    }
41
}
42