mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2026-03-17 19:28:06 +00:00
apply more cs rules for php-cs
This commit is contained in:
@@ -13,9 +13,6 @@ namespace Chill\MainBundle\Service\Import;
|
||||
|
||||
use Doctrine\DBAL\Connection;
|
||||
use Doctrine\DBAL\Statement;
|
||||
use Exception;
|
||||
use function array_key_exists;
|
||||
use function count;
|
||||
|
||||
/**
|
||||
* Optimized way to load postal code into database.
|
||||
@@ -85,14 +82,14 @@ class PostalCodeBaseImporter
|
||||
$centerSRID,
|
||||
];
|
||||
|
||||
if (100 <= count($this->waitingForInsert)) {
|
||||
if (100 <= \count($this->waitingForInsert)) {
|
||||
$this->doInsertPending();
|
||||
}
|
||||
}
|
||||
|
||||
private function doInsertPending(): void
|
||||
{
|
||||
if (!array_key_exists($forNumber = count($this->waitingForInsert), $this->cachingStatements)) {
|
||||
if (!\array_key_exists($forNumber = \count($this->waitingForInsert), $this->cachingStatements)) {
|
||||
$sql = strtr(self::QUERY, [
|
||||
'{{ values }}' => implode(
|
||||
', ',
|
||||
@@ -107,9 +104,9 @@ class PostalCodeBaseImporter
|
||||
|
||||
try {
|
||||
$statement->executeStatement(array_merge(...$this->waitingForInsert));
|
||||
} catch (Exception $e) {
|
||||
} catch (\Exception $e) {
|
||||
// in some case, we can add debug code here
|
||||
//dump($this->waitingForInsert);
|
||||
// dump($this->waitingForInsert);
|
||||
throw $e;
|
||||
} finally {
|
||||
$this->waitingForInsert = [];
|
||||
|
||||
Reference in New Issue
Block a user