apply more cs rules for php-cs

This commit is contained in:
2023-10-17 13:27:03 +02:00
parent 0b0cbed9db
commit bc2041cbdd
1485 changed files with 8169 additions and 9620 deletions

View File

@@ -19,7 +19,7 @@ final readonly class CollateAddressWithReferenceOrPostalCode implements CollateA
private const LOG_PREFIX = '[collate addresses] ';
/**
* For the address having an "invented" postal code, find the postal code "reference" with the same code,
* and the most similar name. When two reference code match, we add
* and the most similar name. When two reference code match, we add.
*
* This query intentionally includes also address with reference, as the reference may be wrong.
*/
@@ -77,7 +77,7 @@ final readonly class CollateAddressWithReferenceOrPostalCode implements CollateA
SQL;
/**
* Update the point's address with the:
* Update the point's address with the:.
*
* - address reference point, if the address match the reference with sufficient similarity
* - or the postcal code center
@@ -97,7 +97,6 @@ final readonly class CollateAddressWithReferenceOrPostalCode implements CollateA
SELECT MAX(id) AS max_id FROM chill_main_address;
SQL;
public function __construct(
private Connection $connection,
private LoggerInterface $logger,
@@ -128,15 +127,15 @@ final readonly class CollateAddressWithReferenceOrPostalCode implements CollateA
];
});
} catch (\Throwable $e) {
$this->logger->error(self::LOG_PREFIX . "error while re-collating addresses", [
$this->logger->error(self::LOG_PREFIX.'error while re-collating addresses', [
'message' => $e->getMessage(),
'trace' => $e->getTraceAsString()
'trace' => $e->getTraceAsString(),
]);
throw $e;
}
$this->logger->info(self::LOG_PREFIX . "Collate the addresses with reference", [
$this->logger->info(self::LOG_PREFIX.'Collate the addresses with reference', [
'set_postcode_from_most_similar' => $postCodeSetReferenceFromMostSimilar,
'address_reference_match' => $addressReferenceMatch,
'point_update' => $pointUpdates,

View File

@@ -13,11 +13,8 @@ namespace Chill\MainBundle\Service\AddressGeographicalUnit;
use Chill\MainBundle\Cron\CronJobInterface;
use Chill\MainBundle\Entity\CronJobExecution;
use DateInterval;
use DateTimeImmutable;
use Doctrine\DBAL\Connection;
use Symfony\Component\Clock\ClockInterface;
use UnexpectedValueException;
final readonly class RefreshAddressToGeographicalUnitMaterializedViewCronJob implements CronJobInterface
{
@@ -33,14 +30,14 @@ final readonly class RefreshAddressToGeographicalUnitMaterializedViewCronJob imp
}
if ($cronJobExecution->getKey() !== $this->getKey()) {
throw new UnexpectedValueException();
throw new \UnexpectedValueException();
}
$now = $this->clock->now();
return $cronJobExecution->getLastStart() < $now->sub(new DateInterval('P1D'))
return $cronJobExecution->getLastStart() < $now->sub(new \DateInterval('P1D'))
// introduce a random component to ensure a roll when multiple instances are hosted on same machines
&& random_int(0, 10) === 0;
&& 0 === random_int(0, 10);
}
public function getKey(): string