This commit is contained in:
2022-03-19 12:10:47 +01:00
parent caaa25ef8e
commit a2daeff384
5 changed files with 10 additions and 9 deletions

View File

@@ -26,6 +26,7 @@ use Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\Validator\Validator\ValidatorInterface;
use function count;
use function strlen;
class LoadPostalCodesCommand extends Command
{
@@ -118,11 +119,11 @@ class LoadPostalCodesCommand extends Command
private function addPostalCode($row, OutputInterface $output)
{
if($row[2] == 'FR' && strlen($row[0]) == 4) {
if ('FR' === $row[2] && strlen($row[0]) === 4) {
// CP in FRANCE are on 5 digit
// For CP starting with a zero, the starting zero can be remove if stored as number in a csv
// add a zero if CP from FR and on 4 digit
$row[0] = '0'.$row[0];
$row[0] = '0' . $row[0];
}
if ($output->getVerbosity() >= OutputInterface::VERBOSITY_VERBOSE) {