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
22
return new Renderer(/** @scrutinizer ignore-type */ $view->render(), $uploadPath);
Loading history...
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
45
{
46
return new Renderer($html, $uploadPath);
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
57
{
58
return new Renderer(file_get_contents($path), $uploadPath);