Fixed inspection issues

This commit is contained in:
Jan Böhmer 2025-01-04 01:20:08 +01:00
parent e40850e0b2
commit 92847643e3
3 changed files with 6 additions and 7 deletions

View file

@ -160,9 +160,8 @@ final class DTOtoEntityConverter
//Try to map the category to an existing entity (but never create a new one) //Try to map the category to an existing entity (but never create a new one)
if ($dto->category) { if ($dto->category) {
/** @var CategoryRepository<Category> $categoryRepo */ //@phpstan-ignore-next-line For some reason php does not recognize the repo returns a category
$categoryRepo = $this->em->getRepository(Category::class); $entity->setCategory($this->em->getRepository(Category::class)->findForInfoProvider($dto->category));
$entity->setCategory($categoryRepo->findForInfoProvider($dto->category));
} }
$entity->setManufacturer($this->getOrCreateEntity(Manufacturer::class, $dto->manufacturer)); $entity->setManufacturer($this->getOrCreateEntity(Manufacturer::class, $dto->manufacturer));

View file

@ -75,7 +75,7 @@ final class BarcodeScanHelper
* will try to guess the type. * will try to guess the type.
* @param string $input * @param string $input
* @param BarcodeSourceType|null $type * @param BarcodeSourceType|null $type
* @return LocalBarcodeScanResult * @return BarcodeScanResultInterface
*/ */
public function scanBarcodeContent(string $input, ?BarcodeSourceType $type = null): BarcodeScanResultInterface public function scanBarcodeContent(string $input, ?BarcodeSourceType $type = null): BarcodeScanResultInterface
{ {

View file

@ -53,7 +53,7 @@ class EIGP114BarcodeScanResult implements BarcodeScanResultInterface
public readonly ?int $quantity; public readonly ?int $quantity;
/** /**
* @var string|mixed|null Customer assigned purchase order number * @var string|null Customer assigned purchase order number
*/ */
public readonly ?string $customerPO; public readonly ?string $customerPO;
@ -104,7 +104,7 @@ class EIGP114BarcodeScanResult implements BarcodeScanResultInterface
public readonly ?string $packageId1; public readonly ?string $packageId1;
/** /**
* @var string|mixed|null * @var string|null
* 4S - Package ID for Logistic Carton with like items * 4S - Package ID for Logistic Carton with like items
*/ */
public readonly ?string $packageId2; public readonly ?string $packageId2;
@ -317,7 +317,7 @@ class EIGP114BarcodeScanResult implements BarcodeScanResultInterface
]; ];
//Iterate over all fields of this object and add them to the array if they are not null //Iterate over all fields of this object and add them to the array if they are not null
foreach($this as $key => $value) { foreach((array) $this as $key => $value) {
//Skip data key //Skip data key
if ($key === 'data') { if ($key === 'data') {
continue; continue;