[backend] stabilise codebase
This commit is contained in:
@@ -6,9 +6,6 @@ namespace App\DataFixtures;
|
||||
|
||||
use App\Entity\Signal;
|
||||
use App\ValueObject\Point;
|
||||
use DateInterval;
|
||||
use DateTimeImmutable;
|
||||
use DateTimeZone;
|
||||
use Doctrine\Bundle\FixturesBundle\Fixture;
|
||||
use Doctrine\Persistence\ObjectManager;
|
||||
|
||||
@@ -16,7 +13,6 @@ class SignalFixtures extends Fixture
|
||||
{
|
||||
public function load(ObjectManager $manager): void
|
||||
{
|
||||
$baseTime = new DateTimeImmutable('2024-08-01 12:00:00', new DateTimeZone('UTC'));
|
||||
$coordinates = [
|
||||
[
|
||||
'user' => 'user-alpha',
|
||||
@@ -41,11 +37,11 @@ class SignalFixtures extends Fixture
|
||||
foreach ($coordinates as $config) {
|
||||
$signalLocation = Point::fromLatLng($config['lat'], $config['lng']);
|
||||
|
||||
$signal = new Signal()
|
||||
->setUserKey($config['user'])
|
||||
->setUserLocation(Point::fromLatLng($config['lat'], $config['lng']))
|
||||
->setSignalLocation($signalLocation)
|
||||
->setCreatedAt($baseTime->add(new DateInterval(sprintf('PT%dM', $config['offset']))));
|
||||
$signal = Signal::create(
|
||||
$config['user'],
|
||||
Point::fromLatLng($config['lat'], $config['lng']),
|
||||
$signalLocation,
|
||||
);
|
||||
|
||||
$manager->persist($signal);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user