mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 22:53:49 +00:00
Ensure loading of postal code does not fails
This commit is contained in:
@@ -45,10 +45,6 @@ class LoadCalendarRange extends Fixture implements FixtureGroupInterface, Ordere
|
||||
|
||||
public function load(ObjectManager $manager): void
|
||||
{
|
||||
$arr = range(-50, 50);
|
||||
|
||||
echo "Creating calendar range ('plage de disponibilités')\n";
|
||||
|
||||
$users = $this->userRepository->findAll();
|
||||
|
||||
$location = (new Location())
|
||||
@@ -69,6 +65,8 @@ class LoadCalendarRange extends Fixture implements FixtureGroupInterface, Ordere
|
||||
$manager->persist($type);
|
||||
$manager->persist($location);
|
||||
|
||||
$now = new DateTimeImmutable();
|
||||
|
||||
$days = [
|
||||
'2021-08-23',
|
||||
'2021-08-24',
|
||||
@@ -80,6 +78,10 @@ class LoadCalendarRange extends Fixture implements FixtureGroupInterface, Ordere
|
||||
'2021-09-02',
|
||||
(new DateTimeImmutable('tomorrow'))->format('Y-m-d'),
|
||||
(new DateTimeImmutable('today'))->format('Y-m-d'),
|
||||
$now->add(new \DateInterval('P7D'))->format('Y-m-d'),
|
||||
$now->add(new \DateInterval('P8D'))->format('Y-m-d'),
|
||||
$now->add(new \DateInterval('P9D'))->format('Y-m-d'),
|
||||
$now->add(new \DateInterval('P10D'))->format('Y-m-d'),
|
||||
];
|
||||
|
||||
$hours = [
|
||||
|
@@ -357,11 +357,11 @@ class LoadPostalCodes extends AbstractFixture implements OrderedFixtureInterface
|
||||
$c->setRefPostalCodeId($code[3]);
|
||||
}
|
||||
|
||||
if (null !== $code[4] & null !== $code[5]) {
|
||||
if (null !== ($code[4] ?? null) & null !== ($code[5] ?? null)) {
|
||||
$c->setCenter(Point::fromLonLat((float) $code[5], (float) $code[4]));
|
||||
}
|
||||
|
||||
if (null !== $code[6]) {
|
||||
if (null !== ($code[6] ?? null)) {
|
||||
$c->setPostalCodeSource($code[6]);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user