Fixed some PHPStan level 5 issues

This commit is contained in:
Jan Böhmer 2023-06-13 20:24:54 +02:00
parent 74051c5649
commit 19530a9102
35 changed files with 95 additions and 63 deletions

View file

@ -132,6 +132,14 @@ final class LabelExampleElementsGenerator
return $user;
}
/**
* @template T of AbstractStructuralDBElement
* @param string $class
* @phpstan-param class-string<T> $class
* @return AbstractStructuralDBElement
* @phpstan-return T
* @throws \ReflectionException
*/
private function getStructuralData(string $class): AbstractStructuralDBElement
{
if (!is_a($class, AbstractStructuralDBElement::class, true)) {

View file

@ -22,6 +22,7 @@ declare(strict_types=1);
*/
namespace App\Services\LabelSystem\PlaceholderProviders;
use App\Entity\LabelSystem\BarcodeType;
use App\Entity\LabelSystem\LabelOptions;
use App\Services\LabelSystem\BarcodeGenerator;
use App\Services\LabelSystem\Barcodes\BarcodeContentGenerator;
@ -52,19 +53,19 @@ final class BarcodeProvider implements PlaceholderProviderInterface
if ('[[BARCODE_QR]]' === $placeholder) {
$label_options = new LabelOptions();
$label_options->setBarcodeType('qr');
$label_options->setBarcodeType(BarcodeType::QR);
return $this->barcodeGenerator->generateHTMLBarcode($label_options, $label_target);
}
if ('[[BARCODE_C39]]' === $placeholder) {
$label_options = new LabelOptions();
$label_options->setBarcodeType('code39');
$label_options->setBarcodeType(BarcodeType::CODE39);
return $this->barcodeGenerator->generateHTMLBarcode($label_options, $label_target);
}
if ('[[BARCODE_C128]]' === $placeholder) {
$label_options = new LabelOptions();
$label_options->setBarcodeType('code128');
$label_options->setBarcodeType(BarcodeType::CODE128);
return $this->barcodeGenerator->generateHTMLBarcode($label_options, $label_target);
}