From 2b15d25ebe1a9323a2e4542da1ecff80ac0360e8 Mon Sep 17 00:00:00 2001 From: Robin Krahnen Date: Mon, 20 Sep 2021 18:12:51 +0200 Subject: [PATCH] optimized use statements --- Classes/Service/SequenceGenerator.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Classes/Service/SequenceGenerator.php b/Classes/Service/SequenceGenerator.php index d0e462b..d9a3399 100644 --- a/Classes/Service/SequenceGenerator.php +++ b/Classes/Service/SequenceGenerator.php @@ -5,7 +5,7 @@ declare(strict_types=1); namespace DigiComp\Sequence\Service; use DigiComp\Sequence\Domain\Model\Insert; -use Doctrine\DBAL\Exception as DBALException; +use Doctrine\DBAL\Exception as DoctrineDBALException; use Doctrine\ORM\EntityManagerInterface; use Neos\Flow\Annotations as Flow; use Neos\Utility\TypeHandling; @@ -35,10 +35,9 @@ class SequenceGenerator /** * @param string|object $type - * * @return int * @throws Exception - * @throws DBALException + * @throws DoctrineDBALException */ public function getNextNumberFor($type): int { @@ -70,7 +69,7 @@ class SequenceGenerator return true; } catch (\PDOException $e) { return false; - } catch (DBALException $e) { + } catch (DoctrineDBALException $e) { if (!$e->getPrevious() instanceof \PDOException) { $this->logger->critical('Exception occured: ' . $e->getMessage()); } @@ -97,10 +96,9 @@ class SequenceGenerator /** * @param string|object $type - * * @return int * @throws Exception - * @throws DBALException + * @throws DoctrineDBALException */ public function getLastNumberFor($type): int {