From 9a98436eb82319f7b858b279b2d935578a2c710e Mon Sep 17 00:00:00 2001 From: mitsuha_s Date: Fri, 21 Jul 2023 16:16:16 +0300 Subject: [PATCH] unnecessary .gitignore files removed, double quotes changed to single quotes --- migrations/.gitignore | 0 src/Controller/.gitignore | 0 src/Controller/PasteController.php | 4 ++-- src/Entity/Paste.php | 8 ++++---- src/Form/Type/PasteForm.php | 16 ++++++++-------- src/Repository/.gitignore | 0 6 files changed, 14 insertions(+), 14 deletions(-) delete mode 100644 migrations/.gitignore delete mode 100644 src/Controller/.gitignore delete mode 100644 src/Repository/.gitignore diff --git a/migrations/.gitignore b/migrations/.gitignore deleted file mode 100644 index e69de29..0000000 diff --git a/src/Controller/.gitignore b/src/Controller/.gitignore deleted file mode 100644 index e69de29..0000000 diff --git a/src/Controller/PasteController.php b/src/Controller/PasteController.php index 163e159..d7ca3e7 100644 --- a/src/Controller/PasteController.php +++ b/src/Controller/PasteController.php @@ -26,7 +26,7 @@ class PasteController extends AbstractController $paste->setPublishDate(new \DateTime()); if ($paste->isPrivate()) { - $paste->setSecret(hash("sha1", random_bytes(25))); + $paste->setSecret(hash('sha1', random_bytes(25))); } $entityManager->persist($paste); @@ -43,7 +43,7 @@ class PasteController extends AbstractController #[Route('/{id}/{secret}')] public function show_paste(PasteRepository $pasteRepository, Request $request, string $id, ?string $secret=NULL): Response { - $paste = $pasteRepository->findOneBy(["id" => $id, "secret" => $secret]); + $paste = $pasteRepository->findOneBy(['id' => $id, 'secret' => $secret]); $form = $this->createForm(PasteForm::class, $paste); return $this->render('paste.html.twig', [ diff --git a/src/Entity/Paste.php b/src/Entity/Paste.php index 2262ca7..cd27422 100644 --- a/src/Entity/Paste.php +++ b/src/Entity/Paste.php @@ -14,18 +14,18 @@ class Paste #[ORM\Column(nullable: false)] private int $id; - #[ORM\Column(type: "text", nullable: false)] + #[ORM\Column(type: 'text', nullable: false)] #[Assert\NotBlank] private string $text; - #[ORM\Column(type: "boolean", nullable: false)] + #[ORM\Column(type: 'boolean', nullable: false)] #[Assert\Type(\boolean::class)] private bool $private; #[ORM\Column(length: 25, nullable: true)] private ?string $language; - #[ORM\Column(type: "text", nullable: true)] + #[ORM\Column(type: 'text', nullable: true)] private ?string $description; #[ORM\Column(length: 128, nullable: true)] @@ -33,7 +33,7 @@ class Paste #[ORM\Column(length: 128, nullable: false)] #[Assert\NotBlank] - private string $author = "anonymous"; + private string $author = 'anonymous'; #[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: false)] #[Assert\Type(\DateTime::class)] diff --git a/src/Form/Type/PasteForm.php b/src/Form/Type/PasteForm.php index 4fefa43..e0f0016 100644 --- a/src/Form/Type/PasteForm.php +++ b/src/Form/Type/PasteForm.php @@ -15,14 +15,14 @@ class PasteForm extends AbstractType { public function buildForm(FormBuilderInterface $builder, array $options): void { $builder - ->add("language", ChoiceType::class, ["choices" => ["Python" => "python", "PHP" => "php", "Plain text" => NULL]]) - ->add("description", TextType::class, ["required" => false]) - ->add("text", TextareaType::class) - ->add("author", TextType::class, ["attr" => ["maxlength" =>128]]) - ->add("filename", TextType::class, ["required" => false, "attr" => ["maxlength" =>128]]) - ->add("expirationDate", DateTimeType::class, ["required" => false, "date_widget" => "single_text", "input" => "datetime"]) - ->add("private", CheckboxType::class, ["required" => false]) - ->add("save", SubmitType::class) + ->add('language', ChoiceType::class, ['choices' => ['Python' => 'python', 'PHP' => 'php', 'Plain text' => NULL]]) + ->add('description', TextType::class, ['required' => false]) + ->add('text', TextareaType::class) + ->add('author', TextType::class, ['attr' => ['maxlength' =>128]]) + ->add('filename', TextType::class, ['required' => false, 'attr' => ['maxlength' =>128]]) + ->add('expirationDate', DateTimeType::class, ['required' => false, 'date_widget' => 'single_text', 'input' => 'datetime']) + ->add('private', CheckboxType::class, ['required' => false]) + ->add('save', SubmitType::class) ; } } \ No newline at end of file diff --git a/src/Repository/.gitignore b/src/Repository/.gitignore deleted file mode 100644 index e69de29..0000000