Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand All @@ -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,
Expand Down
5 changes: 3 additions & 2 deletions ruleset/phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
parameters:
level: 4
reportUnmatchedIgnoredErrors: false
checkMissingIterableValueType: false
checkGenericClassInNonGenericObjectType: false
treatPhpDocTypesAsCertain: false
ignoreErrors:
- identifier: phpDoc.parseError
bootstrapFiles:
- ../vendor/autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Loading