From a0b5b74b364511f56576b45dc566da0ad42a010a Mon Sep 17 00:00:00 2001 From: Robin Krahnen Date: Wed, 4 Dec 2019 12:48:02 +0100 Subject: [PATCH] optimized code to fit our coding guideline; made some small optimizations if possible --- Classes/Domain/Model/Insert.php | 5 +++-- Classes/Service/SequenceGenerator.php | 4 +--- Migrations/Mysql/Version20140505093853.php | 16 +++++++++++----- Migrations/Mysql/Version20160624203903.php | 5 +---- Tests/Functional/SequenceTest.php | 2 +- 5 files changed, 17 insertions(+), 15 deletions(-) diff --git a/Classes/Domain/Model/Insert.php b/Classes/Domain/Model/Insert.php index d14443f..723292e 100644 --- a/Classes/Domain/Model/Insert.php +++ b/Classes/Domain/Model/Insert.php @@ -7,9 +7,10 @@ use Neos\Flow\Annotations as Flow; /** * SequenceInsert * - * @author fcool * @Flow\Entity - * @ORM\Table(indexes={@ORM\Index(name="type_idx", columns={"type"})}) + * @ORM\Table(indexes={ + * @ORM\Index(name="type_idx", columns={"type"}) + * }) */ class Insert { diff --git a/Classes/Service/SequenceGenerator.php b/Classes/Service/SequenceGenerator.php index 34e6c90..3dfb70e 100644 --- a/Classes/Service/SequenceGenerator.php +++ b/Classes/Service/SequenceGenerator.php @@ -77,9 +77,7 @@ class SequenceGenerator } catch (\PDOException $e) { return false; } catch (DBALException $e) { - if ($e->getPrevious() && $e->getPrevious() instanceof \PDOException) { - // Do nothing, new Doctrine handling hides the above error - } else { + if (! $e->getPrevious() instanceof \PDOException) { $this->systemLogger->logException($e); } } catch (\Exception $e) { diff --git a/Migrations/Mysql/Version20140505093853.php b/Migrations/Mysql/Version20140505093853.php index 88c4dfe..4f4f5e7 100644 --- a/Migrations/Mysql/Version20140505093853.php +++ b/Migrations/Mysql/Version20140505093853.php @@ -1,18 +1,25 @@ getNextNumberFor($sequenceGenerator); } - //making a hard exit to avoid phpunit having the tables cleaned up again + // making a hard exit to avoid phpunit having the tables cleaned up again exit; } }