Applied rector with PHP8.1 migration rules

This commit is contained in:
Jan Böhmer 2023-06-11 14:15:46 +02:00
parent dc6a67c2f0
commit 7ee01d9a05
303 changed files with 1228 additions and 3465 deletions

View file

@ -31,15 +31,10 @@ use Symfony\Component\Serializer\Normalizer\ObjectNormalizer;
class StructuralElementDenormalizer implements \Symfony\Component\Serializer\Normalizer\DenormalizerInterface, CacheableSupportsMethodInterface
{
private DenormalizerInterface $normalizer;
private EntityManagerInterface $entityManager;
private array $object_cache = [];
public function __construct(ObjectNormalizer $normalizer, EntityManagerInterface $entityManager)
public function __construct(private readonly ObjectNormalizer $normalizer, private readonly EntityManagerInterface $entityManager)
{
$this->normalizer = $normalizer;
$this->entityManager = $entityManager;
}
public function supportsDenormalization($data, string $type, string $format = null, array $context = []): bool
@ -61,7 +56,7 @@ class StructuralElementDenormalizer implements \Symfony\Component\Serializer\Nor
$path = $deserialized_entity->getFullPath(AbstractStructuralDBElement::PATH_DELIMITER_ARROW);
$db_elements = $repo->getEntityByPath($path, AbstractStructuralDBElement::PATH_DELIMITER_ARROW);
if ($db_elements) {
if ($db_elements !== []) {
//We already have the entity in the database, so we can return it
return end($db_elements);
}