| Total Complexity | 4 |
| Total Lines | 50 |
| Duplicated Lines | 0 % |
| Changes | 4 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 9 | class PdfExportService |
||
| 10 | { |
||
| 11 | // todo: add ability to pass urls to export |
||
| 12 | |||
| 13 | /** |
||
| 14 | * Provide a view to build the PDF from. |
||
| 15 | * |
||
| 16 | * @param View $view |
||
| 17 | * @param string|null $uploadPath |
||
| 18 | * @return Renderer |
||
| 19 | */ |
||
| 20 | public static function fromView(View $view, string $uploadPath = null): Renderer |
||
| 23 | } |
||
| 24 | |||
| 25 | /** |
||
| 26 | * Provide a view to build the PDF from. |
||
| 27 | * |
||
| 28 | * @param AbstractViewModel $viewModel |
||
| 29 | * @param string|null $uploadPath |
||
| 30 | * @return Renderer |
||
| 31 | */ |
||
| 32 | public static function fromViewModel(AbstractViewModel $viewModel, string $uploadPath = null): Renderer |
||
| 33 | { |
||
| 34 | return new Renderer($viewModel->renderNoCache(), $uploadPath); |
||
| 35 | } |
||
| 36 | |||
| 37 | /** |
||
| 38 | * Provide an HTML string to build the PDF from. |
||
| 39 | * |
||
| 40 | * @param string $html |
||
| 41 | * @param string|null $uploadPath |
||
| 42 | * @return Renderer |
||
| 43 | */ |
||
| 44 | public static function fromHtml(string $html, string $uploadPath = null): Renderer |
||
| 47 | } |
||
| 48 | |||
| 49 | /** |
||
| 50 | * Provide an HTML path to build the PDF from. |
||
| 51 | * |
||
| 52 | * @param string $path |
||
| 53 | * @param string|null $uploadPath |
||
| 54 | * @return Renderer |
||
| 55 | */ |
||
| 56 | public static function fromHtmlFile(string $path, string $uploadPath = null): Renderer |
||
| 61 |