mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-27 04:08:57 +02:00
Fixed some PHPStan level 5 issues
This commit is contained in:
parent
74051c5649
commit
19530a9102
35 changed files with 95 additions and 63 deletions
|
@ -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)) {
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue