Skip to content

Commit

Permalink
Fix Dummy resources
Browse files Browse the repository at this point in the history
  • Loading branch information
loic425 committed Oct 20, 2023
1 parent f59d970 commit 03dc051
Show file tree
Hide file tree
Showing 15 changed files with 33 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@

namespace Sylius\Component\Resource\Tests\Dummy;

use Sylius\Component\Resource\Metadata\AsResource;
use Sylius\Component\Resource\Metadata\Create;
use Sylius\Component\Resource\Metadata\Index;
use Sylius\Component\Resource\Metadata\ResourceMetadata;
use Sylius\Component\Resource\Metadata\Show;

#[ResourceMetadata(alias: 'app.order')]
#[AsResource(alias: 'app.order')]
#[Index]
#[Create]
#[ResourceMetadata(alias: 'app.cart')]
#[AsResource(alias: 'app.cart')]
#[Index]
#[Show]
final class DummyMultiResourcesWithOperations
Expand Down
4 changes: 2 additions & 2 deletions src/Component/Tests/Dummy/DummyResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@

namespace Sylius\Component\Resource\Tests\Dummy;

use Sylius\Component\Resource\Metadata\ResourceMetadata;
use Sylius\Component\Resource\Metadata\AsResource;

#[ResourceMetadata]
#[AsResource]
final class DummyResource
{
}
4 changes: 2 additions & 2 deletions src/Component/Tests/Dummy/DummyResourceWithAlias.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@

namespace Sylius\Component\Resource\Tests\Dummy;

use Sylius\Component\Resource\Metadata\ResourceMetadata;
use Sylius\Component\Resource\Metadata\AsResource;

#[ResourceMetadata(alias: 'app.dummy')]
#[AsResource(alias: 'app.dummy')]
final class DummyResourceWithAlias
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@

use Sylius\Component\Resource\Metadata\Create;
use Sylius\Component\Resource\Metadata\Index;
use Sylius\Component\Resource\Metadata\ResourceMetadata;
use Sylius\Component\Resource\Metadata\AsResource;
use Sylius\Component\Resource\Metadata\Show;
use Sylius\Component\Resource\Metadata\Update;

#[ResourceMetadata(alias: 'app.dummy', denormalizationContext: ['groups' => ['dummy:write']])]
#[AsResource(alias: 'app.dummy', denormalizationContext: ['groups' => ['dummy:write']])]
#[Create]
#[Update]
#[Index]
Expand Down
4 changes: 2 additions & 2 deletions src/Component/Tests/Dummy/DummyResourceWithFormOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
namespace Sylius\Component\Resource\Tests\Dummy;

use Sylius\Component\Resource\Metadata\Create;
use Sylius\Component\Resource\Metadata\ResourceMetadata;
use Sylius\Component\Resource\Metadata\AsResource;
use Sylius\Component\Resource\Metadata\Update;

#[ResourceMetadata(alias: 'app.dummy')]
#[AsResource(alias: 'app.dummy')]
#[Create(formOptions: ['html5' => false])]
#[Update(formOptions: ['html5' => true])]
final class DummyResourceWithFormOptions
Expand Down
4 changes: 2 additions & 2 deletions src/Component/Tests/Dummy/DummyResourceWithFormType.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
namespace Sylius\Component\Resource\Tests\Dummy;

use Sylius\Component\Resource\Metadata\Create;
use Sylius\Component\Resource\Metadata\ResourceMetadata;
use Sylius\Component\Resource\Metadata\AsResource;
use Sylius\Component\Resource\Metadata\Update;

#[ResourceMetadata(alias: 'app.dummy', formType: 'App\Form\DummyType')]
#[AsResource(alias: 'app.dummy', formType: 'App\Form\DummyType')]
#[Create]
#[Update]
final class DummyResourceWithFormType
Expand Down
4 changes: 2 additions & 2 deletions src/Component/Tests/Dummy/DummyResourceWithGrid.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@

use Sylius\Component\Resource\Metadata\Create;
use Sylius\Component\Resource\Metadata\Index;
use Sylius\Component\Resource\Metadata\ResourceMetadata;
use Sylius\Component\Resource\Metadata\AsResource;
use Sylius\Component\Resource\Metadata\Show;
use Sylius\Component\Resource\Metadata\Update;

#[ResourceMetadata(alias: 'app.dummy')]
#[AsResource(alias: 'app.dummy')]
#[Create]
#[Update]
#[Index(grid: 'app_dummy')]
Expand Down
4 changes: 2 additions & 2 deletions src/Component/Tests/Dummy/DummyResourceWithName.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@

use Sylius\Component\Resource\Metadata\Create;
use Sylius\Component\Resource\Metadata\Index;
use Sylius\Component\Resource\Metadata\ResourceMetadata;
use Sylius\Component\Resource\Metadata\AsResource;
use Sylius\Component\Resource\Metadata\Show;
use Sylius\Component\Resource\Metadata\Update;

#[ResourceMetadata(alias: 'app.dummy', name: 'book')]
#[AsResource(alias: 'app.dummy', name: 'book')]
#[Create]
#[Update]
#[Index]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@

use Sylius\Component\Resource\Metadata\Create;
use Sylius\Component\Resource\Metadata\Index;
use Sylius\Component\Resource\Metadata\ResourceMetadata;
use Sylius\Component\Resource\Metadata\AsResource;
use Sylius\Component\Resource\Metadata\Show;
use Sylius\Component\Resource\Metadata\Update;

#[ResourceMetadata(alias: 'app.dummy', normalizationContext: ['groups' => ['dummy:read']])]
#[AsResource(alias: 'app.dummy', normalizationContext: ['groups' => ['dummy:read']])]
#[Create]
#[Update]
#[Index]
Expand Down
4 changes: 2 additions & 2 deletions src/Component/Tests/Dummy/DummyResourceWithOperations.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@

use Sylius\Component\Resource\Metadata\Create;
use Sylius\Component\Resource\Metadata\Index;
use Sylius\Component\Resource\Metadata\ResourceMetadata;
use Sylius\Component\Resource\Metadata\AsResource;
use Sylius\Component\Resource\Metadata\Show;
use Sylius\Component\Resource\Metadata\Update;

#[ResourceMetadata(alias: 'app.dummy')]
#[AsResource(alias: 'app.dummy')]
#[Index]
#[Create]
#[Update]
Expand Down
4 changes: 2 additions & 2 deletions src/Component/Tests/Dummy/DummyResourceWithPluralName.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@

use Sylius\Component\Resource\Metadata\Create;
use Sylius\Component\Resource\Metadata\Index;
use Sylius\Component\Resource\Metadata\ResourceMetadata;
use Sylius\Component\Resource\Metadata\AsResource;
use Sylius\Component\Resource\Metadata\Show;
use Sylius\Component\Resource\Metadata\Update;

#[ResourceMetadata(alias: 'app.dummy', pluralName: 'books')]
#[AsResource(alias: 'app.dummy', pluralName: 'books')]
#[Create]
#[Update]
#[Index]
Expand Down
4 changes: 2 additions & 2 deletions src/Component/Tests/Dummy/DummyResourceWithRoutePrefix.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@

use Sylius\Component\Resource\Metadata\Create;
use Sylius\Component\Resource\Metadata\Index;
use Sylius\Component\Resource\Metadata\ResourceMetadata;
use Sylius\Component\Resource\Metadata\AsResource;
use Sylius\Component\Resource\Metadata\Show;
use Sylius\Component\Resource\Metadata\Update;

#[ResourceMetadata(alias: 'app.dummy', routePrefix: '/admin')]
#[AsResource(alias: 'app.dummy', routePrefix: '/admin')]
#[Create]
#[Update]
#[Index]
Expand Down
6 changes: 3 additions & 3 deletions src/Component/Tests/Dummy/DummyResourceWithSections.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@

use Sylius\Component\Resource\Metadata\Create;
use Sylius\Component\Resource\Metadata\Index;
use Sylius\Component\Resource\Metadata\ResourceMetadata;
use Sylius\Component\Resource\Metadata\AsResource;
use Sylius\Component\Resource\Metadata\Show;

#[ResourceMetadata(alias: 'app.dummy', section: 'admin')]
#[AsResource(alias: 'app.dummy', section: 'admin')]
#[Index]
#[Create]
#[ResourceMetadata(alias: 'app.dummy', section: 'shop')]
#[AsResource(alias: 'app.dummy', section: 'shop')]
#[Index]
#[Show]
final class DummyResourceWithSections
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@

use Sylius\Component\Resource\Metadata\Create;
use Sylius\Component\Resource\Metadata\Index;
use Sylius\Component\Resource\Metadata\ResourceMetadata;
use Sylius\Component\Resource\Metadata\AsResource;
use Sylius\Component\Resource\Metadata\Show;

#[ResourceMetadata(
#[AsResource(
alias: 'app.dummy',
section: 'admin',
operations: [
new Index(),
new Create(),
],
)]
#[ResourceMetadata(
#[AsResource(
alias: 'app.dummy',
section: 'shop',
operations: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
namespace Sylius\Component\Resource\Tests\Dummy;

use Sylius\Component\Resource\Metadata\Create;
use Sylius\Component\Resource\Metadata\ResourceMetadata;
use Sylius\Component\Resource\Metadata\AsResource;
use Sylius\Component\Resource\Metadata\Update;

#[ResourceMetadata(alias: 'app.dummy', validationContext: ['groups' => ['sylius']])]
#[AsResource(alias: 'app.dummy', validationContext: ['groups' => ['sylius']])]
#[Create]
#[Update]
final class DummyResourceWithValidationContext
Expand Down

0 comments on commit 03dc051

Please sign in to comment.