lint
This commit is contained in:
parent
a541338909
commit
7663f684a4
9 changed files with 50 additions and 32 deletions
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
|
@ -12,7 +12,7 @@ use Symfony\Component\HttpFoundation\Response;
|
|||
use Symfony\Component\Routing\Attribute\Route;
|
||||
|
||||
#[Route('/food/vendor')]
|
||||
class FoodVendorController extends AbstractController
|
||||
final class FoodVendorController extends AbstractController
|
||||
{
|
||||
#[Route('/', name: 'app_food_vendor_index', methods: ['GET'])]
|
||||
public function index(FoodVendorRepository $foodVendorRepository): Response
|
||||
|
@ -25,7 +25,7 @@ class FoodVendorController extends AbstractController
|
|||
#[Route('/new', name: 'app_food_vendor_new', methods: ['GET', 'POST'])]
|
||||
public function new(Request $request, EntityManagerInterface $entityManager): Response
|
||||
{
|
||||
$foodVendor = new FoodVendor();
|
||||
$foodVendor = new FoodVendor;
|
||||
$form = $this->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();
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
|
@ -18,14 +18,14 @@ class FoodVendor
|
|||
private Ulid|null $id = null;
|
||||
|
||||
#[ORM\Column(length: 50)]
|
||||
private ?string $name = null;
|
||||
private string|null $name = null;
|
||||
|
||||
public function getId(): ?Ulid
|
||||
public function getId(): Ulid|null
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getName(): ?string
|
||||
public function getName(): string|null
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
|
|
@ -1,14 +1,16 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace App\Form;
|
||||
|
||||
use App\Entity\FoodVendor;
|
||||
use Override;
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class FoodVendorType extends AbstractType
|
||||
final class FoodVendorType extends AbstractType
|
||||
{
|
||||
#[Override]
|
||||
public function buildForm(FormBuilderInterface $builder, array $options): void
|
||||
{
|
||||
$builder
|
||||
|
@ -16,6 +18,7 @@ class FoodVendorType extends AbstractType
|
|||
;
|
||||
}
|
||||
|
||||
#[Override]
|
||||
public function configureOptions(OptionsResolver $resolver): void
|
||||
{
|
||||
$resolver->setDefaults([
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<?php
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
|
@ -9,7 +9,7 @@ use Doctrine\Persistence\ManagerRegistry;
|
|||
/**
|
||||
* @extends ServiceEntityRepository<FoodVendor>
|
||||
*/
|
||||
class FoodVendorRepository extends ServiceEntityRepository
|
||||
final class FoodVendorRepository extends ServiceEntityRepository
|
||||
{
|
||||
public function __construct(ManagerRegistry $registry)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue