mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-01-20 17:19:34 +00:00
Fixed inspection issues
This commit is contained in:
parent
e40850e0b2
commit
92847643e3
3 changed files with 6 additions and 7 deletions
|
|
@ -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));
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue