From 306414e24bae3b2d54f5901139d0293e2abe4679 Mon Sep 17 00:00:00 2001 From: tim Date: Fri, 5 Jul 2024 23:08:05 +0200 Subject: [PATCH] Update to symfony 7+ --- composer.json | 4 ++-- src/Controller/ParameterController.php | 2 +- src/Entity/Parameter.php | 25 ++++++++----------------- 3 files changed, 11 insertions(+), 20 deletions(-) diff --git a/composer.json b/composer.json index 7a373be..ab34cd3 100644 --- a/composer.json +++ b/composer.json @@ -5,8 +5,8 @@ "require": { "php": "^8.1", "doctrine/orm": "^2.0", - "symfony/form": "^5.0|^6.0", - "symfony/twig-bundle": "^5.0|^6.0" + "symfony/form": "^5.0|^6.0|^7.0", + "symfony/twig-bundle": "^5.0|^6.0|^7.0" }, "autoload": { "psr-4": { diff --git a/src/Controller/ParameterController.php b/src/Controller/ParameterController.php index c982627..9bcbfbd 100644 --- a/src/Controller/ParameterController.php +++ b/src/Controller/ParameterController.php @@ -7,7 +7,7 @@ namespace Ardent\ParameterBundle\Controller; use Ardent\ParameterBundle\Service\ParameterService; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; class ParameterController extends BaseController { diff --git a/src/Entity/Parameter.php b/src/Entity/Parameter.php index 92d43b9..4191efa 100644 --- a/src/Entity/Parameter.php +++ b/src/Entity/Parameter.php @@ -2,32 +2,23 @@ namespace Ardent\ParameterBundle\Entity; -use Doctrine\DBAL\Types\TextType; use Doctrine\ORM\Mapping as ORM; use Symfony\Component\Form\Extension\Core\Type\CheckboxType; use Symfony\Component\Form\Extension\Core\Type\NumberType; -/** - * @ORM\Entity - * @ORM\Table(name="parameter_bundle_parameters") - */ +#[ORM\Entity()] +#[ORM\Table(name: 'parameter_bundle_parameters')] class Parameter { - /** - * @ORM\Id - * @ORM\GeneratedValue(strategy="AUTO") - * @ORM\Column(type="integer") - */ - private ?int $id; + #[ORM\Id] + #[ORM\GeneratedValue] + #[ORM\Column] + private ?int $id = null; - /** - * @ORM\Column(type="string") - */ + #[ORM\Column] private ?string $name; - /** - * @ORM\Column(type="string") - */ + #[ORM\Column(type: 'string')] private mixed $value; public function getId(): int