From 3d7cf8f7f37217c2d7e6c59b77ea8e751a4f4a86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20B=C3=B6hmer?= Date: Sun, 11 Jun 2023 19:42:02 +0200 Subject: [PATCH] Removed remaining annotations --- src/Controller/PartController.php | 8 +++----- src/Entity/Attachments/AttachmentContainingDBElement.php | 5 +---- src/Services/ProjectSystem/ProjectBuildHelper.php | 2 +- src/Validator/Constraints/ValidFileFilter.php | 3 --- 4 files changed, 5 insertions(+), 13 deletions(-) diff --git a/src/Controller/PartController.php b/src/Controller/PartController.php index 2434415e..2083c340 100644 --- a/src/Controller/PartController.php +++ b/src/Controller/PartController.php @@ -48,6 +48,7 @@ use Doctrine\ORM\EntityManagerInterface; use Exception; use Omines\DataTablesBundle\DataTableFactory; use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; +use Symfony\Bridge\Doctrine\Attribute\MapEntity; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\Form\FormInterface; use Symfony\Component\HttpFoundation\RedirectResponse; @@ -198,16 +199,13 @@ class PartController extends AbstractController return $this->redirectToRoute('homepage'); } - /** - * @ParamConverter("part", options={"id" = "id"}) - * @ParamConverter("project", options={"id" = "project_id"}) - */ #[Route(path: '/new', name: 'part_new')] #[Route(path: '/{id}/clone', name: 'part_clone')] #[Route(path: '/new_build_part/{project_id}', name: 'part_new_build_part')] public function new(Request $request, EntityManagerInterface $em, TranslatorInterface $translator, AttachmentSubmitHandler $attachmentSubmitHandler, ProjectBuildPartHelper $projectBuildPartHelper, - ?Part $part = null, ?Project $project = null): Response + #[MapEntity(mapping: ['id' => 'id'])] ?Part $part = null, + #[MapEntity(mapping: ['id' => 'project_id'])] ?Project $project = null): Response { if ($part instanceof Part) { diff --git a/src/Entity/Attachments/AttachmentContainingDBElement.php b/src/Entity/Attachments/AttachmentContainingDBElement.php index d2d772e8..340c5d77 100644 --- a/src/Entity/Attachments/AttachmentContainingDBElement.php +++ b/src/Entity/Attachments/AttachmentContainingDBElement.php @@ -38,10 +38,7 @@ abstract class AttachmentContainingDBElement extends AbstractNamedDBElement impl /** * @var Attachment[]|Collection - * //TODO - * //@ORM\OneToMany(targetEntity="Attachment", mappedBy="element") - * - * Mapping is done in sub classes like part + * ORM Mapping is done in subclasses (e.g. Part) */ #[Groups(['full'])] protected Collection $attachments; diff --git a/src/Services/ProjectSystem/ProjectBuildHelper.php b/src/Services/ProjectSystem/ProjectBuildHelper.php index 256958f2..1d0b4549 100644 --- a/src/Services/ProjectSystem/ProjectBuildHelper.php +++ b/src/Services/ProjectSystem/ProjectBuildHelper.php @@ -80,7 +80,7 @@ class ProjectBuildHelper /** * Checks if the given project can be built with the current stock. * This means that the maximum buildable count is greater or equal than the requested $number_of_projects - * @parm int $number_of_builds + * @param int $number_of_builds */ public function isProjectBuildable(Project $project, int $number_of_builds = 1): bool { diff --git a/src/Validator/Constraints/ValidFileFilter.php b/src/Validator/Constraints/ValidFileFilter.php index 756e6a37..d962c0ea 100644 --- a/src/Validator/Constraints/ValidFileFilter.php +++ b/src/Validator/Constraints/ValidFileFilter.php @@ -24,9 +24,6 @@ namespace App\Validator\Constraints; use Symfony\Component\Validator\Constraint; -/** - * @Annotation - */ #[\Attribute(\Attribute::TARGET_PROPERTY)] class ValidFileFilter extends Constraint {