diff --git a/composer.json b/composer.json index dc5afdc..b17e3f2 100644 --- a/composer.json +++ b/composer.json @@ -20,8 +20,8 @@ "exclude-from-classmap": ["/Tests/"] }, "require": { - "php": "~8.3.0", - "oro/commerce": "6.0.*" + "php": "~8.5.0", + "oro/commerce": "7.0.*" }, "repositories": { "oro": { @@ -36,9 +36,8 @@ "friendsofphp/php-cs-fixer": "^3.13", "php-parallel-lint/php-parallel-lint": "^1.3", "phpmd/phpmd": "^2.13", - "phpro/grumphp": "^1.15", - "phpspec/phpspec": "^7.2", - "phpstan/phpstan": "^1.5" + "phpro/grumphp": "^2.10.0", + "phpstan/phpstan": "^2.0" }, "config": { "sort-packages": true, diff --git a/ruleset/phpstan.neon b/ruleset/phpstan.neon index 18b0548..a121e65 100644 --- a/ruleset/phpstan.neon +++ b/ruleset/phpstan.neon @@ -1,7 +1,8 @@ parameters: level: 4 reportUnmatchedIgnoredErrors: false - checkMissingIterableValueType: false - checkGenericClassInNonGenericObjectType: false + treatPhpDocTypesAsCertain: false + ignoreErrors: + - identifier: phpDoc.parseError bootstrapFiles: - ../vendor/autoload.php \ No newline at end of file diff --git a/src/Synolia/Bundle/StockAlertBundle/Controller/Frontend/StockAlertController.php b/src/Synolia/Bundle/StockAlertBundle/Controller/Frontend/StockAlertController.php index 12d0376..8b8a72d 100644 --- a/src/Synolia/Bundle/StockAlertBundle/Controller/Frontend/StockAlertController.php +++ b/src/Synolia/Bundle/StockAlertBundle/Controller/Frontend/StockAlertController.php @@ -8,12 +8,12 @@ use Oro\Bundle\LayoutBundle\Attribute\Layout; use Oro\Bundle\ProductBundle\Entity\Product; use Oro\Bundle\SecurityBundle\Attribute\CsrfProtection; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; +use Symfony\Bridge\Doctrine\Attribute\MapEntity; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Symfony\Contracts\Translation\TranslatorInterface; use Synolia\Bundle\StockAlertBundle\Entity\StockAlert; use Synolia\Bundle\StockAlertBundle\Form\Type\StockAlertType; @@ -95,8 +95,7 @@ public function indexAction(): array } #[Route(path: '/create/{id}', name: 'synolia_stock_alert_create', requirements: ['id' => '\d+']) ] - #[ParamConverter('product', class: Product::class, options: ['id' => 'id'])] - public function createAction(Product $product): JsonResponse + public function createAction(#[MapEntity(id: 'id')] Product $product): JsonResponse { try { $stockAlert = $this->handler->create($product); @@ -118,8 +117,7 @@ public function createAction(Product $product): JsonResponse #[Route(path: '/delete/{id}', name: 'synolia_stock_alert_delete', requirements: ['id' => '\d+'], methods: ['DELETE']) ] #[CsrfProtection()] - #[ParamConverter('product', class: Product::class, options: ['id' => 'id'])] - public function deleteAction(Product $product): JsonResponse + public function deleteAction(#[MapEntity(id: 'id')] Product $product): JsonResponse { try { $this->handler->deleteByProduct($product); diff --git a/src/Synolia/Bundle/StockAlertBundle/Controller/StockAlertController.php b/src/Synolia/Bundle/StockAlertBundle/Controller/StockAlertController.php index e40b4db..6c300c3 100644 --- a/src/Synolia/Bundle/StockAlertBundle/Controller/StockAlertController.php +++ b/src/Synolia/Bundle/StockAlertBundle/Controller/StockAlertController.php @@ -4,9 +4,9 @@ namespace Synolia\Bundle\StockAlertBundle\Controller; -use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; +use Symfony\Bridge\Twig\Attribute\Template; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Synolia\Bundle\StockAlertBundle\Entity\StockAlert; class StockAlertController extends AbstractController diff --git a/src/Synolia/Bundle/StockAlertBundle/Resources/config/oro/routing.yml b/src/Synolia/Bundle/StockAlertBundle/Resources/config/oro/routing.yml index c3658c9..1bccfb1 100644 --- a/src/Synolia/Bundle/StockAlertBundle/Resources/config/oro/routing.yml +++ b/src/Synolia/Bundle/StockAlertBundle/Resources/config/oro/routing.yml @@ -1,11 +1,11 @@ synolia_stock_alert: resource: "@SynoliaStockAlertBundle/Controller/Frontend/StockAlertController.php" - type: annotation + type: attribute prefix: /stock-alert options: frontend: true synolia_admin_stock_alert: resource: "@SynoliaStockAlertBundle/Controller/StockAlertController.php" - type: annotation + type: attribute prefix: /stock-alert