It seems like $view->render() can also be of type array; however, parameter $content of Sfneal\ViewExport\Pdf\Ut...Renderer::__construct() does only seem to accept string, maybe add an additional type check?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the ignore-type annotation
21
return new PdfRenderer(/** @scrutinizer ignore-type */ $view->render());
Loading history...
22
}
23
24
/**
25
* Provide a view to build the PDF from.
26
*
27
* @param ViewModel $viewModel
28
* @return PdfRenderer
29
*/
30
public static function fromViewModel(ViewModel $viewModel): PdfRenderer
31
{
32
return new PdfRenderer($viewModel->renderNoCache());
33
}
34
35
/**
36
* Provide an HTML string to build the PDF from.
37
*
38
* @param string $html
39
* @return PdfRenderer
40
*/
41
public static function fromHtml(string $html): PdfRenderer
42
{
43
return new PdfRenderer($html);
44
}
45
46
/**
47
* Provide an HTML path or URL to build the PDF from.
48
*
49
* @param string $path
50
* @return PdfRenderer
51
*/
52
public static function fromHtmlFile(string $path): PdfRenderer