diff --git a/Classes/Command/SequenceCommandController.php b/Classes/Command/SequenceCommandController.php index d57b4fc..dddc981 100644 --- a/Classes/Command/SequenceCommandController.php +++ b/Classes/Command/SequenceCommandController.php @@ -51,7 +51,7 @@ class SequenceCommandController extends CommandController ->createQuery('SELECT i.type, MAX(i.number) max_number FROM ' . Insert::class . ' i GROUP BY i.type') ->getScalarResult(); foreach ($results as $result) { - $cleanArray[$result['type']] = (int) $result['max_number']; + $cleanArray[$result['type']] = (int)$result['max_number']; } } else { foreach ($typesToClean as $typeToClean) { diff --git a/Classes/Service/SequenceGenerator.php b/Classes/Service/SequenceGenerator.php index 9a38752..2a808ce 100644 --- a/Classes/Service/SequenceGenerator.php +++ b/Classes/Service/SequenceGenerator.php @@ -49,7 +49,7 @@ class SequenceGenerator // TODO: Let increment be configurable per type do { $count++; - } while (! $this->validateFreeNumber($count, $type)); + } while (!$this->validateFreeNumber($count, $type)); return $count; } @@ -71,7 +71,7 @@ class SequenceGenerator } catch (\PDOException $e) { return false; } catch (DBALException $e) { - if (! $e->getPrevious() instanceof \PDOException) { + if (!$e->getPrevious() instanceof \PDOException) { $this->systemLogger->critical('Exception occured: ' . $e->getMessage()); } } catch (\Exception $e) { @@ -104,7 +104,7 @@ class SequenceGenerator */ public function getLastNumberFor($type): int { - return (int) $this->entityManager->getConnection()->executeQuery( + return (int)$this->entityManager->getConnection()->executeQuery( 'SELECT MAX(number) FROM ' . $this->entityManager->getClassMetadata(Insert::class)->getTableName() . ' WHERE type = :type', @@ -122,7 +122,7 @@ class SequenceGenerator if (\is_object($stringOrObject)) { $stringOrObject = TypeHandling::getTypeForValue($stringOrObject); } - if (! $stringOrObject) { + if (!$stringOrObject) { throw new Exception('No Type given'); } diff --git a/Tests/Functional/SequenceTest.php b/Tests/Functional/SequenceTest.php index a4ec07a..7913837 100644 --- a/Tests/Functional/SequenceTest.php +++ b/Tests/Functional/SequenceTest.php @@ -25,7 +25,7 @@ class SequenceTest extends FunctionalTestCase $pIds = []; for ($i = 0; $i < 10; $i++) { - $pId = pcntl_fork(); + $pId = \pcntl_fork(); if ($pId) { $pIds[] = $pId; } else { @@ -39,7 +39,7 @@ class SequenceTest extends FunctionalTestCase foreach ($pIds as $pId) { $status = 0; - pcntl_waitpid($pId, $status); + \pcntl_waitpid($pId, $status); } $this->assertEquals(101, $sequenceGenerator->getLastNumberFor($sequenceGenerator));