From 32fdd37120cf625807f17989279454af74e8f467 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Fr=C3=A9mont?= Date: Fri, 30 Aug 2024 11:49:39 +0200 Subject: [PATCH] Fix few things --- docs/processors.md | 17 ++++++++++++++--- docs/providers.md | 8 ++++---- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/docs/processors.md b/docs/processors.md index 1d8c9b885..60f0309d9 100644 --- a/docs/processors.md +++ b/docs/processors.md @@ -69,8 +69,11 @@ Use this processor on your operation. namespace App\Entity\Customer; use App\Sylius\State\Processor\CreateCustomerProcessor; +use Sylius\Resource\Metadata\AsResource; +use Sylius\Resource\Metadata\Create; +use Sylius\Resource\Model\ResourceInterface; -#[Resource] +#[AsResource] #[Create(processor: CreateCustomerProcessor::class)] final class BoardGameResource implements ResourceInterface ``` @@ -109,7 +112,11 @@ Use this processor on your operation. namespace App\BoardGameBlog\Infrastructure\Sylius\Resource; -#[Resource( +use Sylius\Resource\Metadata\AsResource; +use Sylius\Resource\Metadata\Delete; +use Sylius\Resource\Model\ResourceInterface; + +#[AsResource( alias: 'app.board_game', section: 'admin', formType: BoardGameType::class, @@ -127,7 +134,11 @@ Note that in this case, you can disable providing data. namespace App\BoardGameBlog\Infrastructure\Sylius\Resource; -#[Resource( +use Sylius\Resource\Metadata\AsResource; +use Sylius\Resource\Metadata\Delete; +use Sylius\Resource\Model\ResourceInterface; + +#[AsResource( alias: 'app.board_game', section: 'admin', formType: BoardGameType::class, diff --git a/docs/providers.md b/docs/providers.md index fb0162642..e8dc4f2ab 100644 --- a/docs/providers.md +++ b/docs/providers.md @@ -37,8 +37,8 @@ declare(strict_types=1); namespace App\Entity; use Sylius\Resource\Metadata\AsResource; -use Sylius\Resource\Model\ResourceInterface; use Sylius\Resource\Metadata\Show; +use Sylius\Resource\Model\ResourceInterface; #[AsResource] #[Show(repositoryMethod: 'findOneByEmail')] @@ -68,8 +68,8 @@ declare(strict_types=1); namespace App\Entity; use Sylius\Resource\Metadata\AsResource; -use Sylius\Resource\Model\ResourceInterface; use Sylius\Resource\Metadata\Show; +use Sylius\Resource\Model\ResourceInterface; #[AsResource] #[Show(repositoryMethod: 'findOneByEmail', repositoryArguments: ['email' => "request.attributes.get('email')"])] @@ -126,8 +126,8 @@ namespace App\BoardGameBlog\Infrastructure\Sylius\Resource; use App\BoardGameBlog\Infrastructure\Sylius\State\Provider\BoardGameItemProvider; use Sylius\Resource\Metadata\AsResource; -use Sylius\Resource\Model\ResourceInterface; use Sylius\Resource\Metadata\Show; +use Sylius\Resource\Model\ResourceInterface; #[AsResource] #[Show(provider: BoardGameItemProvider::class)] @@ -152,8 +152,8 @@ namespace App\Entity; use App\BoardgameBlog\Infrastructure\Sylius\State\Provider\DeleteBoardGameProcessor; use Sylius\Resource\Metadata\AsResource; -use Sylius\Resource\Model\ResourceInterface; use Sylius\Resource\Metadata\Delete; +use Sylius\Resource\Model\ResourceInterface; #[AsResource] #[Delete(