mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-27 04:08:57 +02:00
Fixed some inspection issues.
This commit is contained in:
parent
6caf605fe2
commit
e01b06fb85
80 changed files with 173 additions and 218 deletions
|
@ -78,7 +78,7 @@ final class LabelGenerator
|
|||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function supports(LabelOptions $options, object $element)
|
||||
public function supports(LabelOptions $options, object $element): bool
|
||||
{
|
||||
$supported_type = $options->getSupportedElement();
|
||||
if (!isset(static::CLASS_SUPPORT_MAPPING[$supported_type])) {
|
||||
|
|
|
@ -68,7 +68,7 @@ final class LabelHTMLGenerator
|
|||
|
||||
$page = 1;
|
||||
foreach ($elements as $element) {
|
||||
if ('twig' === $options->getLinesMode() && isset($sandboxed_twig) && isset($current_user)) {
|
||||
if (isset($sandboxed_twig, $current_user) && 'twig' === $options->getLinesMode()) {
|
||||
try {
|
||||
$lines = $sandboxed_twig->render(
|
||||
'lines',
|
||||
|
@ -103,7 +103,7 @@ final class LabelHTMLGenerator
|
|||
]);
|
||||
}
|
||||
|
||||
private function getPDFTitle(LabelOptions $options, object $element)
|
||||
private function getPDFTitle(LabelOptions $options, object $element): string
|
||||
{
|
||||
if ($element instanceof NamedElementInterface) {
|
||||
return $this->elementTypeNameGenerator->getTypeNameCombination($element, false);
|
||||
|
|
|
@ -44,7 +44,7 @@ final class PartLotProvider implements PlaceholderProviderInterface
|
|||
{
|
||||
if ($label_target instanceof PartLot) {
|
||||
if ('[[LOT_ID]]' === $placeholder) {
|
||||
return $label_target->getID() ?? 'unknown';
|
||||
return (string) ($label_target->getID() ?? 'unknown');
|
||||
}
|
||||
|
||||
if ('[[LOT_NAME]]' === $placeholder) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue