@@ -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. |
@@ -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 | } |
@@ -59,7 +59,7 @@ |
||
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 |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | $this->configuration = $configuration; |
33 | 33 | $this->transactionManager = new TransactionManager($this); |
34 | 34 | |
35 | - \assert($this->configuration instanceof Configuration); // helps PHPStan |
|
35 | + \assert($this->configuration instanceof Configuration); // helps PHPStan |
|
36 | 36 | $this->configuration->setProvider($this); |
37 | 37 | } |
38 | 38 | |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | { |
41 | 41 | parent::registerAuditingService($service); |
42 | 42 | |
43 | - \assert($service instanceof AuditingService); // helps PHPStan |
|
43 | + \assert($service instanceof AuditingService); // helps PHPStan |
|
44 | 44 | $entityManager = $service->getEntityManager(); |
45 | 45 | $evm = $entityManager->getEventManager(); |
46 | 46 | |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | public function getAuditingServiceForEntity(string $entity): AuditingServiceInterface |
60 | 60 | { |
61 | 61 | foreach ($this->auditingServices as $name => $service) { |
62 | - \assert($service instanceof AuditingService); // helps PHPStan |
|
62 | + \assert($service instanceof AuditingService); // helps PHPStan |
|
63 | 63 | |
64 | 64 | try { |
65 | 65 | // entity is managed by the entity manager of this service |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | { |
78 | 78 | $this->checkStorageMapper(); |
79 | 79 | |
80 | - \assert($this->configuration instanceof Configuration); // helps PHPStan |
|
80 | + \assert($this->configuration instanceof Configuration); // helps PHPStan |
|
81 | 81 | $storageMapper = $this->configuration->getStorageMapper(); |
82 | 82 | |
83 | 83 | if (null === $storageMapper || 1 === \count($this->getStorageServices())) { |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | return array_values($this->getStorageServices())[0]; |
86 | 86 | } |
87 | 87 | |
88 | - \assert(\is_callable($storageMapper)); // helps PHPStan |
|
88 | + \assert(\is_callable($storageMapper)); // helps PHPStan |
|
89 | 89 | |
90 | 90 | return $storageMapper($entity, $this->getStorageServices()); |
91 | 91 | } |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | { |
144 | 144 | $class = DoctrineHelper::getRealClassName($entity); |
145 | 145 | // is $entity part of audited entities? |
146 | - \assert($this->configuration instanceof Configuration); // helps PHPStan |
|
146 | + \assert($this->configuration instanceof Configuration); // helps PHPStan |
|
147 | 147 | if (!\array_key_exists($class, $this->configuration->getEntities())) { |
148 | 148 | // no => $entity is not audited |
149 | 149 | return false; |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | public function isAuditedField($entity, string $field): bool |
196 | 196 | { |
197 | 197 | // is $field is part of globally ignored columns? |
198 | - \assert($this->configuration instanceof Configuration); // helps PHPStan |
|
198 | + \assert($this->configuration instanceof Configuration); // helps PHPStan |
|
199 | 199 | if (\in_array($field, $this->configuration->getIgnoredColumns(), true)) { |
200 | 200 | // yes => $field is not audited |
201 | 201 | return false; |
@@ -237,13 +237,13 @@ discard block |
||
237 | 237 | |
238 | 238 | public function setStorageMapper(callable $storageMapper): void |
239 | 239 | { |
240 | - \assert($this->configuration instanceof Configuration); // helps PHPStan |
|
240 | + \assert($this->configuration instanceof Configuration); // helps PHPStan |
|
241 | 241 | $this->configuration->setStorageMapper($storageMapper); |
242 | 242 | } |
243 | 243 | |
244 | 244 | public function loadAnnotations(EntityManagerInterface $entityManager, ?array $entities = null): self |
245 | 245 | { |
246 | - \assert($this->configuration instanceof Configuration); // helps PHPStan |
|
246 | + \assert($this->configuration instanceof Configuration); // helps PHPStan |
|
247 | 247 | $annotationLoader = new AnnotationLoader($entityManager); |
248 | 248 | $this->configuration->setEntities(array_merge( |
249 | 249 | null === $entities ? $this->configuration->getEntities() : $entities, |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | |
256 | 256 | private function checkStorageMapper(): self |
257 | 257 | { |
258 | - \assert($this->configuration instanceof Configuration); // helps PHPStan |
|
258 | + \assert($this->configuration instanceof Configuration); // helps PHPStan |
|
259 | 259 | if (null === $this->configuration->getStorageMapper() && $this->isStorageMapperRequired()) { |
260 | 260 | throw new ProviderException('You must provide a mapper function to map audits to storage.'); |
261 | 261 | } |
@@ -27,7 +27,7 @@ |
||
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 |