diff --git a/.gitignore b/.gitignore index 16bc576..50bc37d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ /.idea /vendor .php_cs.cache -/composer.lock \ No newline at end of file +/composer.lock.php-cs-fixer.cache diff --git a/README.md b/README.md index d63b186..66570dc 100644 --- a/README.md +++ b/README.md @@ -16,8 +16,8 @@ This plugin allows you to save products as favorite in OroCommerce | | Version | | :--- |:--------| -| PHP | 8.4 | -| OroCommerce | 6.1.* | +| PHP | 8.5 | +| OroCommerce | 7.0.* | ## Installation diff --git a/composer.json b/composer.json index 12d938c..ede64f3 100644 --- a/composer.json +++ b/composer.json @@ -19,8 +19,8 @@ "exclude-from-classmap": ["/Tests/"] }, "require": { - "php": "~8.4.0", - "oro/commerce": "6.1.*" + "php": "~8.5.0", + "oro/commerce": "7.0.*" }, "repositories": { "oro": { @@ -32,12 +32,11 @@ "prefer-stable": true, "require-dev": { "enlightn/security-checker": "^1.9", - "friendsofphp/php-cs-fixer": "~3.57.2", + "friendsofphp/php-cs-fixer": "^3.57", "php-parallel-lint/php-parallel-lint": "^1.3", "phpmd/phpmd": "~2.15.0", - "phpro/grumphp": "^1.5", - "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..a9fcf5c 100644 --- a/ruleset/phpstan.neon +++ b/ruleset/phpstan.neon @@ -1,7 +1,7 @@ parameters: level: 4 reportUnmatchedIgnoredErrors: false - checkMissingIterableValueType: false - checkGenericClassInNonGenericObjectType: false + ignoreErrors: + - identifier: phpDoc.parseError bootstrapFiles: - ../vendor/autoload.php \ No newline at end of file diff --git a/src/Synolia/Bundle/FavoriteBundle/Controller/Frontend/FavoriteButtonAjaxController.php b/src/Synolia/Bundle/FavoriteBundle/Controller/Frontend/FavoriteButtonAjaxController.php index 003967d..fe6f342 100644 --- a/src/Synolia/Bundle/FavoriteBundle/Controller/Frontend/FavoriteButtonAjaxController.php +++ b/src/Synolia/Bundle/FavoriteBundle/Controller/Frontend/FavoriteButtonAjaxController.php @@ -9,14 +9,13 @@ use Oro\Bundle\SecurityBundle\Authentication\TokenAccessorInterface; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Symfony\Component\HttpFoundation\JsonResponse; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Synolia\Bundle\FavoriteBundle\Handler\FavoriteButtonAjaxHandler; -#[Route('/ajax', options: ["expose"=>true])] - +#[Route(options: ["expose"=>true])] class FavoriteButtonAjaxController extends AbstractController { - #[Route('/update/{id}', name: 'synolia_favorite_button_ajax_update', requirements: ['id' => '\d+'], methods: ['POST'])] + #[Route('/ajax/update/{id}', name: 'synolia_favorite_button_ajax_update', requirements: ['id' => '\d+'], methods: ['POST'])] public function updateAction( Product $product, TokenAccessorInterface $tokenAccessor, diff --git a/src/Synolia/Bundle/FavoriteBundle/Controller/Frontend/FavoriteController.php b/src/Synolia/Bundle/FavoriteBundle/Controller/Frontend/FavoriteController.php index dc99821..3076abb 100644 --- a/src/Synolia/Bundle/FavoriteBundle/Controller/Frontend/FavoriteController.php +++ b/src/Synolia/Bundle/FavoriteBundle/Controller/Frontend/FavoriteController.php @@ -7,7 +7,7 @@ use Oro\Bundle\LayoutBundle\Attribute\Layout; use Oro\Bundle\SecurityBundle\Attribute\Acl; use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; -use Symfony\Component\Routing\Annotation\Route; +use Symfony\Component\Routing\Attribute\Route; use Synolia\Bundle\FavoriteBundle\Entity\Favorite; class FavoriteController extends AbstractController diff --git a/src/Synolia/Bundle/FavoriteBundle/EventListener/FavoriteDatagridListener.php b/src/Synolia/Bundle/FavoriteBundle/EventListener/FavoriteDatagridListener.php index 89c69a8..3d6aa39 100644 --- a/src/Synolia/Bundle/FavoriteBundle/EventListener/FavoriteDatagridListener.php +++ b/src/Synolia/Bundle/FavoriteBundle/EventListener/FavoriteDatagridListener.php @@ -35,8 +35,6 @@ public function onBuildAfter(BuildAfter $event): void return; } - /** @var FavoriteRepository $repo */ - $repo = $this->entityManager->getRepository(Favorite::class); $user = $this->tokenAccessor->getUser(); $organization = $this->tokenAccessor->getOrganization(); $favProductIds = []; diff --git a/src/Synolia/Bundle/FavoriteBundle/EventListener/FrontendProductFavoriteDatagridListener.php b/src/Synolia/Bundle/FavoriteBundle/EventListener/FrontendProductFavoriteDatagridListener.php index 0d928ac..f3aad9f 100644 --- a/src/Synolia/Bundle/FavoriteBundle/EventListener/FrontendProductFavoriteDatagridListener.php +++ b/src/Synolia/Bundle/FavoriteBundle/EventListener/FrontendProductFavoriteDatagridListener.php @@ -10,8 +10,8 @@ use Oro\Bundle\DataGridBundle\Event\BuildBefore; use Oro\Bundle\DataGridBundle\Extension\Formatter\Property\PropertyInterface; use Oro\Bundle\OrganizationBundle\Entity\Organization; -use Oro\Bundle\SecurityBundle\Authentication\TokenAccessorInterface; use Oro\Bundle\SearchBundle\Datagrid\Event\SearchResultAfter; +use Oro\Bundle\SecurityBundle\Authentication\TokenAccessorInterface; use Oro\Bundle\SecurityBundle\ORM\Walker\AclHelper; use Synolia\Bundle\FavoriteBundle\Entity\Favorite; use Synolia\Bundle\FavoriteBundle\Entity\Repository\FavoriteRepository; diff --git a/src/Synolia/Bundle/FavoriteBundle/Migrations/Schema/v1_1/AddSerializeDataColumn.php b/src/Synolia/Bundle/FavoriteBundle/Migrations/Schema/v1_1/AddSerializeDataColumn.php index c5cc830..6af1966 100644 --- a/src/Synolia/Bundle/FavoriteBundle/Migrations/Schema/v1_1/AddSerializeDataColumn.php +++ b/src/Synolia/Bundle/FavoriteBundle/Migrations/Schema/v1_1/AddSerializeDataColumn.php @@ -17,7 +17,7 @@ class AddSerializeDataColumn implements Migration public function up(Schema $schema, QueryBag $queries): void { $table = $schema->getTable('synolia_favorite'); - if($table->hasColumn('serialize_data')) { + if ($table->hasColumn('serialize_data')) { return; } $table->addColumn('serialized_data', Types::JSON, ['notnull' => false]); diff --git a/src/Synolia/Bundle/FavoriteBundle/Resources/config/oro/routing.yml b/src/Synolia/Bundle/FavoriteBundle/Resources/config/oro/routing.yml index 91ec1ec..4dba3da 100644 --- a/src/Synolia/Bundle/FavoriteBundle/Resources/config/oro/routing.yml +++ b/src/Synolia/Bundle/FavoriteBundle/Resources/config/oro/routing.yml @@ -1,13 +1,13 @@ synolia_ajax_button_favorite: resource: '@SynoliaFavoriteBundle/Controller/Frontend/FavoriteButtonAjaxController.php' - type: annotation + type: attribute prefix: /favorite options: frontend: true synolia_favorite_index: resource: '@SynoliaFavoriteBundle/Controller/Frontend/FavoriteController.php' - type: annotation + type: attribute prefix: /customer/favorite options: frontend: true