| Total Complexity | 8 |
| Total Lines | 63 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | final class OfficeRequest extends Request implements GotenbergRequestInterface |
||
| 8 | { |
||
| 9 | private const LANDSCAPE = 'landscape'; |
||
| 10 | private const PAGE_RANGES = 'pageRanges'; |
||
| 11 | |||
| 12 | /** @var Document[] */ |
||
| 13 | private $files; |
||
| 14 | |||
| 15 | /** @var bool */ |
||
| 16 | private $landscape; |
||
| 17 | |||
| 18 | /** @var string|null */ |
||
| 19 | private $pageRanges; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @param Document[] $files |
||
| 23 | */ |
||
| 24 | public function __construct(array $files) |
||
| 25 | { |
||
| 26 | parent::__construct(); |
||
| 27 | $this->files = $files; |
||
| 28 | } |
||
| 29 | |||
| 30 | public function getPostURL(): string |
||
| 31 | { |
||
| 32 | return '/convert/office'; |
||
| 33 | } |
||
| 34 | |||
| 35 | /** |
||
| 36 | * @return array<string,mixed> |
||
| 37 | */ |
||
| 38 | public function getFormValues(): array |
||
| 39 | { |
||
| 40 | $values = parent::getFormValues(); |
||
| 41 | if ($this->pageRanges !== null) { |
||
| 42 | $values[self::PAGE_RANGES] = $this->pageRanges; |
||
| 43 | } |
||
| 44 | $values[self::LANDSCAPE] = $this->landscape; |
||
| 45 | |||
| 46 | return $values; |
||
| 47 | } |
||
| 48 | |||
| 49 | /** |
||
| 50 | * @return array<string,Document> |
||
| 51 | */ |
||
| 52 | public function getFormFiles(): array |
||
| 60 | } |
||
| 61 | |||
| 62 | public function setLandscape(bool $landscape): void |
||
| 63 | { |
||
| 64 | $this->landscape = $landscape; |
||
| 65 | } |
||
| 66 | |||
| 67 | public function setPageRanges(string $pageRanges): void |
||
| 70 | } |
||
| 71 | } |
||
| 72 |