From 5465b3933289d40cbe2542890ffd9be81e955c06 Mon Sep 17 00:00:00 2001 From: Robin Krahnen Date: Wed, 4 Apr 2018 23:39:03 +0200 Subject: [PATCH] do not save value into variable if it's only returned afterwards --- Classes/Service/SequenceGenerator.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Classes/Service/SequenceGenerator.php b/Classes/Service/SequenceGenerator.php index cedfc92..63cbde4 100644 --- a/Classes/Service/SequenceGenerator.php +++ b/Classes/Service/SequenceGenerator.php @@ -110,14 +110,10 @@ class SequenceGenerator /** @var EntityManager $em */ $em = $this->entityManager; - $result = $em->getConnection()->executeQuery( + return $em->getConnection()->executeQuery( 'SELECT MAX(number) AS count FROM digicomp_sequence_domain_model_insert WHERE type=:type', ['type' => $this->inferTypeFromSource($type)] - ); - $count = $result->fetchAll(); - $count = $count[0]['count']; - - return $count; + )->fetchAll()[0]['count']; } /**