Skip to content

Commit dcc89f9

Browse files
committed
refactor: move symfony messenger from core to symfony
1 parent 8115686 commit dcc89f9

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

core/design.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Again, it's up to the developers to use, or to not use these built-in state prov
4040
they are dealing with.
4141
API Platform makes it easy to create custom state providers and processors.
4242
It also makes it easy to implement patterns such as [CQS](https://www.martinfowler.com/bliki/CommandQuerySeparation.html)
43-
or [CQRS](https://martinfowler.com/bliki/CQRS.html) thanks to [the Messenger Component integration](messenger.md) and the [DTO support](dto.md).
43+
or [CQRS](https://martinfowler.com/bliki/CQRS.html) thanks to [the Messenger Component integration](../symfony/messenger.md) and the [DTO support](dto.md).
4444

4545
Last but not least, to create [Event Sourcing](https://martinfowler.com/eaaDev/EventSourcing.html)-based systems, a convenient
4646
approach is:

core/dto.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ In some cases, using an input DTO is a way to avoid serialization groups.
7575

7676
## Use Messenger With an Input DTO
7777

78-
Let's use a message that will be processed by [Symfony Messenger](https://symfony.com/components/Messenger). API Platform has an [integration with messenger](./messenger.md), to use a DTO as input you need to specify the `input` attribute:
78+
Let's use a message that will be processed by [Symfony Messenger](https://symfony.com/components/Messenger). API Platform has an [integration with messenger](../symfony/messenger.md), to use a DTO as input you need to specify the `input` attribute:
7979

8080
```php
8181
<?php

core/extending.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ The following tables summarizes which extension point to use depending on what y
1616
| [Normalizers](serialization.md#decorating-a-serializer-and-adding-extra-data) | customize the resource sent to the client (add fields in JSON documents, encode codes, dates...) |
1717
| [Filters](filters.md) | create filters for collections and automatically document them (OpenAPI, GraphQL, Hydra) |
1818
| [Serializer Context Builders](serialization.md#changing-the-serialization-context-dynamically) | change the Serialization context (e.g. groups) dynamically |
19-
| [Messenger Handlers](messenger.md) | create 100% custom, RPC, async, service-oriented endpoints (should be used in place of custom controllers because the messenger integration is compatible with both REST and GraphQL, while custom controllers only work with REST) |
19+
| [Messenger Handlers](../symfony/messenger.md) | create 100% custom, RPC, async, service-oriented endpoints (should be used in place of custom controllers because the messenger integration is compatible with both REST and GraphQL, while custom controllers only work with REST) |
2020
| [DTOs](dto.md) | use a specific class to represent the input or output data structure related to an operation |
2121
| [Kernel Events](events.md) | customize the HTTP request or response (REST only, other extension points must be preferred when possible) |
2222

core/migrate-from-fosrestbundle.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Same as above.
3333

3434
Even though this is not recommended, API Platform allows you to [create custom controllers](controllers.md) and declare them in your entity's `ApiResource` attribute.
3535

36-
You can use them as you migrate from FOSRestBundle, but you should consider [switching to Symfony Messenger](messenger.md) as it will give you more benefits, such as compatibility with both REST and GraphQL and better performances of your API on big tasks.
36+
You can use them as you migrate from FOSRestBundle, but you should consider [switching to Symfony Messenger](../symfony/messenger.md) as it will give you more benefits, such as compatibility with both REST and GraphQL and better performances of your API on big tasks.
3737

3838
See [General Design Considerations](design.md).
3939

outline.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ chapters:
99
- testing
1010
- debugging
1111
- caddy
12+
- messenger
1213
- title: "API Platform for Laravel"
1314
path: laravel
1415
items:
@@ -43,7 +44,6 @@ chapters:
4344
- default-order
4445
- performance
4546
- extensions
46-
- messenger
4747
- dto
4848
- openapi
4949
- json-schema

core/messenger.md renamed to symfony/messenger.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ Because the `messenger` attribute is `true`, when a `POST` is handled by API Pla
6969
For this example, only the `POST` operation is enabled. We disabled the item operation using the `NotFoundAction`. A resource must have at least one item operation as it must be identified by an IRI, here the route `/people/1` exists, eventhough it returns a 404 status code.
7070
We use the `status` attribute to configure API Platform to return a [202 Accepted HTTP status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/202).
7171
It indicates that the request has been received and will be treated later, without giving an immediate return to the client.
72-
Finally, the `output` attribute is set to `false`, so the HTTP response that will be generated by API Platform will be empty, and the [serialization process](serialization.md) will be skipped.
72+
Finally, the `output` attribute is set to `false`, so the HTTP response that will be generated by API Platform will be empty, and the [serialization process](../core/serialization.md) will be skipped.
7373

74-
**Note:** when using `messenger=true` ApiResource attribute in a Doctrine entity, the Doctrine Processor is not called. If you want the Doctrine Processor to be called, you should [decorate a built-in state processor](state-processors.md#decorating-the-built-in-state-processors) and implement your own logic.
74+
**Note:** when using `messenger=true` ApiResource attribute in a Doctrine entity, the Doctrine Processor is not called. If you want the Doctrine Processor to be called, you should [decorate a built-in state processor](../core/state-processors.md#creating-a-custom-state-processor) and implement your own logic.
7575

7676
## Registering a Message Handler
7777

@@ -116,7 +116,7 @@ To differentiate typical persists calls (create and update) and removal calls, c
116116

117117
## Using Messenger with an Input Object
118118

119-
Set the `messenger` attribute to `input`, and API Platform will automatically dispatch the given Input as a message instead of the Resource. Indeed, it'll add a default `DataTransformer` ([see input/output documentation](./dto.md)) that handles the given `input`. In this example, we'll handle a `ResetPasswordRequest` on a custom operation on our `User` resource:
119+
Set the `messenger` attribute to `input`, and API Platform will automatically dispatch the given Input as a message instead of the Resource. Indeed, it'll add a default `DataTransformer` ([see input/output documentation](../core/dto.md)) that handles the given `input`. In this example, we'll handle a `ResetPasswordRequest` on a custom operation on our `User` resource:
120120

121121
```php
122122
<?php
@@ -163,7 +163,7 @@ final class ResetPasswordRequest
163163

164164
As above, we use the `status` attribute to configure API Platform to return a [202 Accepted HTTP status code](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/202).
165165
It indicates that the request has been received and will be treated later, without giving an immediate return to the client.
166-
Finally, the `output` attribute is set to `false`, so the HTTP response that will be generated by API Platform will be empty, and the [serialization process](serialization.md) will be skipped.
166+
Finally, the `output` attribute is set to `false`, so the HTTP response that will be generated by API Platform will be empty, and the [serialization process](../core/serialization.md) will be skipped.
167167

168168
In this case, when a `POST` request is issued on `/users/reset_password` the message handler will receive an `App\Dto\ResetPasswordRequest` object instead of a `User` because we specified it as `input` and set `messenger=input`:
169169

0 commit comments

Comments
 (0)