Passed
Push — multiple-schemas-support ( 638643 )
by Damien
08:07
created
src/Provider/Doctrine/Persistence/Command/UpdateSchemaCommand.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -98,7 +98,7 @@
 block discarded – undo
98 98
             $progressBar = new ProgressBar($output, \count($sqls));
99 99
             $progressBar->start();
100 100
 
101
-            $updateManager->updateAuditSchema($sqls, static function (array $progress) use ($progressBar): void {
101
+            $updateManager->updateAuditSchema($sqls, static function(array $progress) use ($progressBar): void {
102 102
                 $progressBar->advance();
103 103
             });
104 104
 
Please login to merge, or discard this patch.
src/Provider/Doctrine/Persistence/Event/CreateSchemaListener.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@
 block discarded – undo
59 59
         $storageServices = $this->provider->getStorageServices();
60 60
 
61 61
         \assert(array_values($auditingServices)[0] instanceof AuditingService); // helps PHPStan
62
-        \assert(array_values($storageServices)[0] instanceof StorageService);   // helps PHPStan
62
+        \assert(array_values($storageServices)[0] instanceof StorageService); // helps PHPStan
63 63
         $isSameEntityManager = 1 === \count($auditingServices) && 1 === \count($storageServices)
64 64
             && array_values($auditingServices)[0]->getEntityManager() === array_values($storageServices)[0]->getEntityManager();
65 65
 
Please login to merge, or discard this patch.
src/Provider/Doctrine/Auditing/Logger/Logger.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
         }
28 28
         // on rollback remove flusher callback
29 29
         if ('"ROLLBACK"' === $sql) {
30
-            $this->flusher = static function (): void {};
30
+            $this->flusher = static function(): void {};
31 31
         }
32 32
     }
33 33
 
Please login to merge, or discard this patch.
rector.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@
 block discarded – undo
9 9
 use Rector\Set\ValueObject\LevelSetList;
10 10
 use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
11 11
 
12
-return static function (ContainerConfigurator $containerConfigurator): void {
12
+return static function(ContainerConfigurator $containerConfigurator): void {
13 13
     $services = $containerConfigurator->services();
14 14
     $services->set(TypedPropertyRector::class);
15 15
 
Please login to merge, or discard this patch.
src/EventSubscriber/AuditEventSubscriber.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
     {
26 26
         return [
27 27
             LifecycleEvent::class => [
28
-                ['onAuditEvent', -1_000_000],  // should be fired last
28
+                ['onAuditEvent', -1_000_000], // should be fired last
29 29
             ],
30 30
         ];
31 31
     }
Please login to merge, or discard this patch.
src/Provider/Doctrine/Auditing/Transaction/AuditTrait.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 
75 75
         switch ($type->getName()) {
76 76
             case DoctrineHelper::getDoctrineType('BIGINT'):
77
-                $convertedValue = (string) $value;  // @phpstan-ignore-line
77
+                $convertedValue = (string) $value; // @phpstan-ignore-line
78 78
 
79 79
                 break;
80 80
 
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
             case 'uuid':
97 97
             case 'ulid':
98 98
                 // Ramsey UUID / Symfony UID (UUID/ULID)
99
-                $convertedValue = (string) $value;  // @phpstan-ignore-line
99
+                $convertedValue = (string) $value; // @phpstan-ignore-line
100 100
 
101 101
                 break;
102 102
 
Please login to merge, or discard this patch.
src/Model/Entry.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -159,7 +159,7 @@
 block discarded – undo
159 159
      */
160 160
     public function getDiffs(bool $includeMedadata = false): ?array
161 161
     {
162
-        $diffs = $this->sort(json_decode($this->diffs, true, 512, JSON_THROW_ON_ERROR));  // @phpstan-ignore-line
162
+        $diffs = $this->sort(json_decode($this->diffs, true, 512, JSON_THROW_ON_ERROR)); // @phpstan-ignore-line
163 163
         if (!$includeMedadata) {
164 164
             unset($diffs['@source']);
165 165
         }
Please login to merge, or discard this patch.
src/Provider/Doctrine/Auditing/Event/DoctrineSubscriber.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
 
44 44
         $driver = $entityManager->getConnection()->getDriver();
45 45
         if ($driver instanceof DHDriver) {
46
-            $driver->addDHFlusher(function () use ($transaction): void {
46
+            $driver->addDHFlusher(function() use ($transaction): void {
47 47
                 $this->transactionManager->process($transaction);
48 48
                 $transaction->reset();
49 49
             });
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
         trigger_deprecation('damienharper/auditor', '2.2', 'SQLLogger is deprecated. Use DHMiddleware instead');
54 54
         // extend the SQL logger
55 55
         $this->loggerBackup = $entityManager->getConnection()->getConfiguration()->getSQLLogger();
56
-        $auditLogger = new Logger(function () use ($entityManager, $transaction): void {
56
+        $auditLogger = new Logger(function() use ($entityManager, $transaction): void {
57 57
             // flushes pending data
58 58
             $entityManager->getConnection()->getConfiguration()->setSQLLogger($this->loggerBackup);
59 59
             $this->transactionManager->process($transaction);
Please login to merge, or discard this patch.
src/Provider/Doctrine/DoctrineProvider.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
         $this->configuration = $configuration;
36 36
         $this->transactionManager = new TransactionManager($this);
37 37
 
38
-        \assert($this->configuration instanceof Configuration);    // helps PHPStan
38
+        \assert($this->configuration instanceof Configuration); // helps PHPStan
39 39
         $this->configuration->setProvider($this);
40 40
     }
41 41
 
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
     {
44 44
         parent::registerAuditingService($service);
45 45
 
46
-        \assert($service instanceof AuditingService);    // helps PHPStan
46
+        \assert($service instanceof AuditingService); // helps PHPStan
47 47
         $entityManager = $service->getEntityManager();
48 48
         $evm = $entityManager->getEventManager();
49 49
 
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
     public function getAuditingServiceForEntity(string $entity): AuditingServiceInterface
64 64
     {
65 65
         foreach ($this->auditingServices as $name => $service) {
66
-            \assert($service instanceof AuditingService);   // helps PHPStan
66
+            \assert($service instanceof AuditingService); // helps PHPStan
67 67
 
68 68
             try {
69 69
                 // entity is managed by the entity manager of this service
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
     {
82 82
         $this->checkStorageMapper();
83 83
 
84
-        \assert($this->configuration instanceof Configuration);   // helps PHPStan
84
+        \assert($this->configuration instanceof Configuration); // helps PHPStan
85 85
         $storageMapper = $this->configuration->getStorageMapper();
86 86
 
87 87
         if (null === $storageMapper || 1 === \count($this->getStorageServices())) {
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
             return array_values($this->getStorageServices())[0];
90 90
         }
91 91
 
92
-        \assert(\is_callable($storageMapper));   // helps PHPStan
92
+        \assert(\is_callable($storageMapper)); // helps PHPStan
93 93
 
94 94
         return $storageMapper($entity, $this->getStorageServices());
95 95
     }
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
     {
147 147
         $class = DoctrineHelper::getRealClassName($entity);
148 148
         // is $entity part of audited entities?
149
-        \assert($this->configuration instanceof Configuration);   // helps PHPStan
149
+        \assert($this->configuration instanceof Configuration); // helps PHPStan
150 150
 
151 151
         // no => $entity is not audited
152 152
         return !(!\array_key_exists($class, $this->configuration->getEntities()));
@@ -196,7 +196,7 @@  discard block
 block discarded – undo
196 196
     public function isAuditedField($entity, string $field): bool
197 197
     {
198 198
         // is $field is part of globally ignored columns?
199
-        \assert($this->configuration instanceof Configuration);   // helps PHPStan
199
+        \assert($this->configuration instanceof Configuration); // helps PHPStan
200 200
         if (\in_array($field, $this->configuration->getIgnoredColumns(), true)) {
201 201
             // yes => $field is not audited
202 202
             return false;
@@ -234,13 +234,13 @@  discard block
 block discarded – undo
234 234
 
235 235
     public function setStorageMapper(callable $storageMapper): void
236 236
     {
237
-        \assert($this->configuration instanceof Configuration);   // helps PHPStan
237
+        \assert($this->configuration instanceof Configuration); // helps PHPStan
238 238
         $this->configuration->setStorageMapper($storageMapper);
239 239
     }
240 240
 
241 241
     public function loadAnnotations(EntityManagerInterface $entityManager, ?array $entities = null): self
242 242
     {
243
-        \assert($this->configuration instanceof Configuration);   // helps PHPStan
243
+        \assert($this->configuration instanceof Configuration); // helps PHPStan
244 244
         $annotationLoader = new AnnotationLoader($entityManager);
245 245
         $this->configuration->setEntities(array_merge(
246 246
             $entities ?? $this->configuration->getEntities(),
@@ -252,7 +252,7 @@  discard block
 block discarded – undo
252 252
 
253 253
     private function checkStorageMapper(): self
254 254
     {
255
-        \assert($this->configuration instanceof Configuration);   // helps PHPStan
255
+        \assert($this->configuration instanceof Configuration); // helps PHPStan
256 256
         if (null === $this->configuration->getStorageMapper() && $this->isStorageMapperRequired()) {
257 257
             throw new ProviderException('You must provide a mapper callback to map audits to storage.');
258 258
         }
Please login to merge, or discard this patch.