do not save value into variable if it's only returned afterwards

This commit is contained in:
Robin Krahnen 2018-04-04 23:39:03 +02:00
parent 1124d3626e
commit 5465b39332

View file

@ -110,14 +110,10 @@ class SequenceGenerator
/** @var EntityManager $em */ /** @var EntityManager $em */
$em = $this->entityManager; $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', 'SELECT MAX(number) AS count FROM digicomp_sequence_domain_model_insert WHERE type=:type',
['type' => $this->inferTypeFromSource($type)] ['type' => $this->inferTypeFromSource($type)]
); )->fetchAll()[0]['count'];
$count = $result->fetchAll();
$count = $count[0]['count'];
return $count;
} }
/** /**