mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-29 05:00:08 +02:00
Improved typing and phpdoc type annotations
This commit is contained in:
parent
3817ba774d
commit
b7c8ca2a48
39 changed files with 189 additions and 129 deletions
|
@ -60,7 +60,9 @@ final class LabelGenerator
|
|||
}
|
||||
|
||||
/**
|
||||
* @param object|object[] $elements An element or an array of elements for which labels should be generated
|
||||
* @param object|object[] $elements An element or an array of elements for which labels should be generated
|
||||
*
|
||||
* @return null|string
|
||||
*/
|
||||
public function generateLabel(LabelOptions $options, object|array $elements): string
|
||||
{
|
||||
|
@ -83,7 +85,7 @@ final class LabelGenerator
|
|||
$dompdf->loadHtml($this->labelHTMLGenerator->getLabelHTML($options, $elements));
|
||||
$dompdf->render();
|
||||
|
||||
return $dompdf->output();
|
||||
return $dompdf->output() ?? throw new \RuntimeException('Could not generate label!');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue