@@ -91,10 +91,10 @@ |
||
| 91 | 91 | ->setAllowedTypes('page', ['null', 'int']) |
| 92 | 92 | ->setAllowedTypes('page_size', ['null', 'int']) |
| 93 | 93 | ->setAllowedTypes('strict', ['null', 'bool']) |
| 94 | - ->setAllowedValues('page', static function ($value) { |
|
| 94 | + ->setAllowedValues('page', static function($value) { |
|
| 95 | 95 | return null === $value || $value >= 1; |
| 96 | 96 | }) |
| 97 | - ->setAllowedValues('page_size', static function ($value) { |
|
| 97 | + ->setAllowedValues('page_size', static function($value) { |
|
| 98 | 98 | return null === $value || $value >= 1; |
| 99 | 99 | }) |
| 100 | 100 | ; |
@@ -98,7 +98,7 @@ |
||
| 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 | |
@@ -93,7 +93,7 @@ |
||
| 93 | 93 | $repository[$key][$entity] = $tableName; |
| 94 | 94 | } |
| 95 | 95 | } |
| 96 | - $findEntityByTablename = static function (string $tableName) use ($repository): ?string { |
|
| 96 | + $findEntityByTablename = static function(string $tableName) use ($repository): ?string { |
|
| 97 | 97 | foreach ($repository as $emName => $map) { |
| 98 | 98 | $result = array_search($tableName, $map, true); |
| 99 | 99 | if (false !== $result) { |
@@ -41,7 +41,7 @@ |
||
| 41 | 41 | |
| 42 | 42 | // extend the SQL logger |
| 43 | 43 | $this->loggerBackup = $entityManager->getConnection()->getConfiguration()->getSQLLogger(); |
| 44 | - $auditLogger = new Logger(function () use ($entityManager, $transaction): void { |
|
| 44 | + $auditLogger = new Logger(function() use ($entityManager, $transaction): void { |
|
| 45 | 45 | // flushes pending data |
| 46 | 46 | $entityManager->getConnection()->getConfiguration()->setSQLLogger($this->loggerBackup); |
| 47 | 47 | $this->transactionManager->process($transaction); |
@@ -18,27 +18,27 @@ |
||
| 18 | 18 | /** |
| 19 | 19 | * @var array |
| 20 | 20 | */ |
| 21 | - private $inserted = []; // [$source, $changeset] |
|
| 21 | + private $inserted = []; // [$source, $changeset] |
|
| 22 | 22 | |
| 23 | 23 | /** |
| 24 | 24 | * @var array |
| 25 | 25 | */ |
| 26 | - private $updated = []; // [$source, $changeset] |
|
| 26 | + private $updated = []; // [$source, $changeset] |
|
| 27 | 27 | |
| 28 | 28 | /** |
| 29 | 29 | * @var array |
| 30 | 30 | */ |
| 31 | - private $removed = []; // [$source, $id] |
|
| 31 | + private $removed = []; // [$source, $id] |
|
| 32 | 32 | |
| 33 | 33 | /** |
| 34 | 34 | * @var array |
| 35 | 35 | */ |
| 36 | - private $associated = []; // [$source, $target, $mapping] |
|
| 36 | + private $associated = []; // [$source, $target, $mapping] |
|
| 37 | 37 | |
| 38 | 38 | /** |
| 39 | 39 | * @var array |
| 40 | 40 | */ |
| 41 | - private $dissociated = []; // [$source, $target, $id, $mapping] |
|
| 41 | + private $dissociated = []; // [$source, $target, $id, $mapping] |
|
| 42 | 42 | |
| 43 | 43 | /** |
| 44 | 44 | * Returns transaction hash. |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | { |
| 37 | 37 | parent::registerAuditingService($service); |
| 38 | 38 | |
| 39 | - \assert($service instanceof AuditingService); // helps PHPStan |
|
| 39 | + \assert($service instanceof AuditingService); // helps PHPStan |
|
| 40 | 40 | $entityManager = $service->getEntityManager(); |
| 41 | 41 | $evm = $entityManager->getEventManager(); |
| 42 | 42 | |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | { |
| 54 | 54 | parent::registerStorageService($service); |
| 55 | 55 | |
| 56 | - \assert($service instanceof StorageService); // helps PHPStan |
|
| 56 | + \assert($service instanceof StorageService); // helps PHPStan |
|
| 57 | 57 | $entityManager = $service->getEntityManager(); |
| 58 | 58 | $evm = $entityManager->getEventManager(); |
| 59 | 59 | |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | { |
| 73 | 73 | $this->checkStorageMapper(); |
| 74 | 74 | |
| 75 | - \assert($this->configuration instanceof Configuration); // helps PHPStan |
|
| 75 | + \assert($this->configuration instanceof Configuration); // helps PHPStan |
|
| 76 | 76 | $storageMapper = $this->configuration->getStorageMapper(); |
| 77 | 77 | |
| 78 | 78 | if (null === $storageMapper || 1 === \count($this->getStorageServices())) { |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | { |
| 132 | 132 | $class = DoctrineHelper::getRealClassName($entity); |
| 133 | 133 | // is $entity part of audited entities? |
| 134 | - \assert($this->configuration instanceof Configuration); // helps PHPStan |
|
| 134 | + \assert($this->configuration instanceof Configuration); // helps PHPStan |
|
| 135 | 135 | if (!\array_key_exists($class, $this->configuration->getEntities())) { |
| 136 | 136 | // no => $entity is not audited |
| 137 | 137 | return false; |
@@ -183,7 +183,7 @@ discard block |
||
| 183 | 183 | public function isAuditedField($entity, string $field): bool |
| 184 | 184 | { |
| 185 | 185 | // is $field is part of globally ignored columns? |
| 186 | - \assert($this->configuration instanceof Configuration); // helps PHPStan |
|
| 186 | + \assert($this->configuration instanceof Configuration); // helps PHPStan |
|
| 187 | 187 | if (\in_array($field, $this->configuration->getIgnoredColumns(), true)) { |
| 188 | 188 | // yes => $field is not audited |
| 189 | 189 | return false; |
@@ -225,13 +225,13 @@ discard block |
||
| 225 | 225 | |
| 226 | 226 | public function setStorageMapper(callable $storageMapper): void |
| 227 | 227 | { |
| 228 | - \assert($this->configuration instanceof Configuration); // helps PHPStan |
|
| 228 | + \assert($this->configuration instanceof Configuration); // helps PHPStan |
|
| 229 | 229 | $this->configuration->setStorageMapper($storageMapper); |
| 230 | 230 | } |
| 231 | 231 | |
| 232 | 232 | private function loadAnnotations(EntityManagerInterface $entityManager): self |
| 233 | 233 | { |
| 234 | - \assert($this->configuration instanceof Configuration); // helps PHPStan |
|
| 234 | + \assert($this->configuration instanceof Configuration); // helps PHPStan |
|
| 235 | 235 | $annotationLoader = new AnnotationLoader($entityManager); |
| 236 | 236 | $this->configuration->setEntities(array_merge( |
| 237 | 237 | $this->configuration->getEntities(), |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | |
| 244 | 244 | private function checkStorageMapper(): self |
| 245 | 245 | { |
| 246 | - \assert($this->configuration instanceof Configuration); // helps PHPStan |
|
| 246 | + \assert($this->configuration instanceof Configuration); // helps PHPStan |
|
| 247 | 247 | if (null === $this->configuration->getStorageMapper() && $this->isStorageMapperRequired()) { |
| 248 | 248 | throw new ProviderException('You must provide a mapper function to map audits to storage.'); |
| 249 | 249 | } |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | { |
| 24 | 24 | return [ |
| 25 | 25 | LifecycleEvent::class => [ |
| 26 | - ['onAuditEvent', -1000000], // should be fired last |
|
| 26 | + ['onAuditEvent', -1000000], // should be fired last |
|
| 27 | 27 | ], |
| 28 | 28 | ]; |
| 29 | 29 | } |
@@ -60,7 +60,7 @@ |
||
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | $storageService = $this->provider->getStorageServiceForEntity($metadata->name); |
| 63 | - \assert($storageService instanceof StorageService); // helps PHPStan |
|
| 63 | + \assert($storageService instanceof StorageService); // helps PHPStan |
|
| 64 | 64 | $connection = $storageService->getEntityManager()->getConnection(); |
| 65 | 65 | $storageSchemaManager = $connection->getSchemaManager(); |
| 66 | 66 | $fromSchema = $storageSchemaManager->createSchema(); |