diff --git a/config/bundles.php b/config/bundles.php index 412a30a..d43fe1e 100644 --- a/config/bundles.php +++ b/config/bundles.php @@ -1,9 +1,25 @@ - ['all' => true], - Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true], - Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true], - Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true], - Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true], + FrameworkBundle::class => [ + 'all' => true, + ], + MakerBundle::class => [ + 'dev' => true, + ], + DoctrineBundle::class => [ + 'all' => true, + ], + DoctrineMigrationsBundle::class => [ + 'all' => true, + ], + TwigBundle::class => [ + 'all' => true, + ], ]; diff --git a/config/packages/twig.php b/config/packages/twig.php index 16dfdd1..23db999 100644 --- a/config/packages/twig.php +++ b/config/packages/twig.php @@ -1,6 +1,4 @@ -createForm(FoodVendorType::class, $foodVendor); $form->handleRequest($request); @@ -71,7 +71,7 @@ class FoodVendorController extends AbstractController #[Route('/{id}', name: 'app_food_vendor_delete', methods: ['POST'])] public function delete(Request $request, FoodVendor $foodVendor, EntityManagerInterface $entityManager): Response { - if ($this->isCsrfTokenValid('delete'.$foodVendor->getId(), $request->getPayload()->getString('_token'))) { + if ($this->isCsrfTokenValid('delete' . $foodVendor->getId(), $request->getPayload()->getString('_token'))) { $entityManager->remove($foodVendor); $entityManager->flush(); } diff --git a/src/Entity/FoodVendor.php b/src/Entity/FoodVendor.php index 0a50088..f71d784 100644 --- a/src/Entity/FoodVendor.php +++ b/src/Entity/FoodVendor.php @@ -1,4 +1,4 @@ -id; } - public function getName(): ?string + public function getName(): string|null { return $this->name; } diff --git a/src/Form/FoodVendorType.php b/src/Form/FoodVendorType.php index 3553856..fcbdce4 100644 --- a/src/Form/FoodVendorType.php +++ b/src/Form/FoodVendorType.php @@ -1,14 +1,16 @@ -setDefaults([ diff --git a/src/Repository/FoodVendorRepository.php b/src/Repository/FoodVendorRepository.php index 2b92afa..8392957 100644 --- a/src/Repository/FoodVendorRepository.php +++ b/src/Repository/FoodVendorRepository.php @@ -1,4 +1,4 @@ - */ -class FoodVendorRepository extends ServiceEntityRepository +final class FoodVendorRepository extends ServiceEntityRepository { public function __construct(ManagerRegistry $registry) { diff --git a/tests/Controller/FoodVendorControllerTest.php b/tests/Controller/FoodVendorControllerTest.php index ef3621d..c923549 100644 --- a/tests/Controller/FoodVendorControllerTest.php +++ b/tests/Controller/FoodVendorControllerTest.php @@ -1,16 +1,18 @@ -manager)) ->createSchema($this->manager->getMetadataFactory()->getAllMetadata()); } + + #[Override] protected function setUp(): void { $this->client = static::createClient(); @@ -38,7 +42,7 @@ class FoodVendorControllerTest extends WebTestCase public function testIndex(): void { - $crawler = $this->client->request('GET', $this->path); + $this->client->request('GET', $this->path); self::assertResponseStatusCodeSame(200); self::assertPageTitleContains('FoodVendor index'); @@ -66,7 +70,7 @@ class FoodVendorControllerTest extends WebTestCase public function testShow(): void { $this->markTestIncomplete(); - $fixture = new FoodVendor(); + $fixture = new FoodVendor; $fixture->setName('My Title'); $this->manager->persist($fixture); @@ -83,7 +87,7 @@ class FoodVendorControllerTest extends WebTestCase public function testEdit(): void { $this->markTestIncomplete(); - $fixture = new FoodVendor(); + $fixture = new FoodVendor; $fixture->setName('Value'); $this->manager->persist($fixture); @@ -105,7 +109,7 @@ class FoodVendorControllerTest extends WebTestCase public function testRemove(): void { $this->markTestIncomplete(); - $fixture = new FoodVendor(); + $fixture = new FoodVendor; $fixture->setName('Value'); $this->manager->persist($fixture); diff --git a/tests/bootstrap.php b/tests/bootstrap.php index 2e5a362..e717c59 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -1,6 +1,5 @@