mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-08-18 00:29:22 +02: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
|
@ -28,11 +28,8 @@ use Symfony\Component\Serializer\Normalizer\DenormalizerInterface;
|
|||
|
||||
class StructuralElementFromNameDenormalizer implements DenormalizerInterface, CacheableSupportsMethodInterface
|
||||
{
|
||||
private EntityManagerInterface $em;
|
||||
|
||||
public function __construct(EntityManagerInterface $em)
|
||||
public function __construct(private readonly EntityManagerInterface $em)
|
||||
{
|
||||
$this->em = $em;
|
||||
}
|
||||
|
||||
public function supportsDenormalization($data, string $type, string $format = null): bool
|
||||
|
@ -54,14 +51,14 @@ class StructuralElementFromNameDenormalizer implements DenormalizerInterface, Ca
|
|||
foreach ($elements as $element) {
|
||||
$this->em->persist($element);
|
||||
}
|
||||
if (empty($elements)) {
|
||||
if ($elements === []) {
|
||||
return null;
|
||||
}
|
||||
return end($elements);
|
||||
}
|
||||
|
||||
$elements = $repo->getEntityByPath($data, $path_delimiter);
|
||||
if (empty($elements)) {
|
||||
if ($elements === []) {
|
||||
return null;
|
||||
}
|
||||
return end($elements);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue