mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-03-08 00:09:37 +00:00
Applied rector with PHP8.1 migration rules
This commit is contained in:
parent
dc6a67c2f0
commit
7ee01d9a05
303 changed files with 1228 additions and 3465 deletions
|
|
@ -32,11 +32,8 @@ use Symfony\Component\Validator\ConstraintValidator;
|
|||
|
||||
class ValidPartLotValidator extends ConstraintValidator
|
||||
{
|
||||
protected EntityManagerInterface $em;
|
||||
|
||||
public function __construct(EntityManagerInterface $em)
|
||||
public function __construct(protected EntityManagerInterface $em)
|
||||
{
|
||||
$this->em = $em;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -56,7 +53,7 @@ class ValidPartLotValidator extends ConstraintValidator
|
|||
}
|
||||
|
||||
//We can only validate the values if we know the storelocation
|
||||
if ($value->getStorageLocation()) {
|
||||
if ($value->getStorageLocation() instanceof \App\Entity\Parts\Storelocation) {
|
||||
$repo = $this->em->getRepository(Storelocation::class);
|
||||
//We can only determine associated parts, if the part have an ID
|
||||
//When the storage location is new (no ID), we can just assume there are no other parts
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue