Skip to content

Commit b1b4f14

Browse files
committedNov 6, 2023
Merge 3.1
2 parents 3ab7e87 + c47b588 commit b1b4f14

23 files changed

+206
-106
lines changed
 

‎src/Doctrine/Odm/Filter/BooleanFilter.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
*
2424
* Syntax: `?property=<true|false|1|0>`.
2525
*
26-
* <CodeSelector>
26+
* <div data-code-selector>
27+
*
2728
* ```php
2829
* <?php
2930
* // api/src/Entity/Book.php
@@ -94,7 +95,8 @@
9495
* </resource>
9596
* </resources>
9697
* ```
97-
* </CodeSelector>
98+
*
99+
* </div>
98100
*
99101
* Given that the collection endpoint is `/books`, you can filter books with the following query: `/books?published=true`.
100102
*

‎src/Doctrine/Odm/Filter/DateFilter.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@
3636
* - Consider items as youngest: use `ApiPlatform\Doctrine\Odm\Filter\DateFilter::INCLUDE_NULL_AFTER` (`include_null_after`) strategy
3737
* - Always include items: use `ApiPlatform\Doctrine\Odm\Filter\DateFilter::INCLUDE_NULL_BEFORE_AND_AFTER` (`include_null_before_and_after`) strategy
3838
*
39-
* <CodeSelector>
39+
* <div data-code-selector>
40+
*
4041
* ```php
4142
* <?php
4243
* // api/src/Entity/Book.php
@@ -107,7 +108,8 @@
107108
* </resource>
108109
* </resources>
109110
* ```
110-
* </CodeSelector>
111+
*
112+
* </div>
111113
*
112114
* Given that the collection endpoint is `/books`, you can filter books by date with the following query: `/books?createdAt[after]=2018-03-19`.
113115
*

‎src/Doctrine/Odm/Filter/ExistsFilter.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
*
2828
* Syntax: `?exists[property]=<true|false|1|0>`.
2929
*
30-
* <CodeSelector>
30+
* <div data-code-selector>
31+
*
3132
* ```php
3233
* <?php
3334
* // api/src/Entity/Book.php
@@ -98,7 +99,8 @@
9899
* </resource>
99100
* </resources>
100101
* ```
101-
* </CodeSelector>
102+
*
103+
* </div>
102104
*
103105
* Given that the collection endpoint is `/books`, you can filter books with the following query: `/books?exists[comment]=true`.
104106
*

‎src/Doctrine/Odm/Filter/NumericFilter.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
*
2424
* Syntax: `?property=<int|bigint|decimal...>`.
2525
*
26-
* <CodeSelector>
26+
* <div data-code-selector>
27+
*
2728
* ```php
2829
* <?php
2930
* // api/src/Entity/Book.php
@@ -94,7 +95,8 @@
9495
* </resource>
9596
* </resources>
9697
* ```
97-
* </CodeSelector>
98+
*
99+
* </div>
98100
*
99101
* Given that the collection endpoint is `/books`, you can filter books with the following query: `/books?price=10`.
100102
*

‎src/Doctrine/Odm/Filter/OrderFilter.php

+8-4
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
*
2727
* Syntax: `?order[property]=<asc|desc>`.
2828
*
29-
* <CodeSelector>
29+
* <div data-code-selector>
30+
*
3031
* ```php
3132
* <?php
3233
* // api/src/Entity/Book.php
@@ -100,13 +101,15 @@
100101
* </resource>
101102
* </resources>
102103
* ```
103-
* </CodeSelector>
104+
*
105+
* </div>
104106
*
105107
* Given that the collection endpoint is `/books`, you can filter books by title in ascending order and then by ID in descending order with the following query: `/books?order[title]=desc&order[id]=asc`.
106108
*
107109
* By default, whenever the query does not specify the direction explicitly (e.g.: `/books?order[title]&order[id]`), filters will not be applied unless you configure a default order direction to use:
108110
*
109-
* <CodeSelector>
111+
* <div data-code-selector>
112+
*
110113
* ```php
111114
* <?php
112115
* // api/src/Entity/Book.php
@@ -179,7 +182,8 @@
179182
* </resource>
180183
* </resources>
181184
* ```
182-
* </CodeSelector>
185+
*
186+
* </div>
183187
*
184188
* When the property used for ordering can contain `null` values, you may want to specify how `null` values are treated in the comparison:
185189
* - Use the default behavior of the DBMS: use `null` strategy

‎src/Doctrine/Odm/Filter/RangeFilter.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
*
2424
* Syntax: `?property[<lt|gt|lte|gte|between>]=value`.
2525
*
26-
* <CodeSelector>
26+
* <div data-code-selector>
27+
*
2728
* ```php
2829
* <?php
2930
* // api/src/Entity/Book.php
@@ -95,7 +96,8 @@
9596
* </resource>
9697
* </resources>
9798
* ```
98-
* </CodeSelector>
99+
*
100+
* </div>
99101
*
100102
* Given that the collection endpoint is `/books`, you can filter books with the following query: `/books?price[between]=12.99..15.99`.
101103
*

‎src/Doctrine/Odm/Filter/SearchFilter.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@
5656
*
5757
* Syntax: `?property[]=foo&property[]=bar`.
5858
*
59-
* <CodeSelector>
59+
* <div data-code-selector>
60+
*
6061
* ```php
6162
* <?php
6263
* // api/src/Entity/Book.php
@@ -129,7 +130,8 @@
129130
* </resource>
130131
* </resources>
131132
* ```
132-
* </CodeSelector>
133+
*
134+
* </div>
133135
*
134136
* @author Kévin Dunglas <dunglas@gmail.com>
135137
* @author Alan Poulain <contact@alanpoulain.eu>

‎src/Doctrine/Orm/Filter/BooleanFilter.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
*
2626
* Syntax: `?property=<true|false|1|0>`.
2727
*
28-
* <CodeSelector>
28+
* <div data-code-selector>
29+
*
2930
* ```php
3031
* <?php
3132
* // api/src/Entity/Book.php
@@ -97,7 +98,8 @@
9798
* </resource>
9899
* </resources>
99100
* ```
100-
* </CodeSelector>
101+
*
102+
* </div>
101103
*
102104
* Given that the collection endpoint is `/books`, you can filter books with the following query: `/books?published=true`.
103105
*

‎src/Doctrine/Orm/Filter/DateFilter.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@
3939
* - Consider items as youngest: use `ApiPlatform\Doctrine\Orm\Filter\DateFilter::INCLUDE_NULL_AFTER` (`include_null_after`) strategy
4040
* - Always include items: use `ApiPlatform\Doctrine\Orm\Filter\DateFilter::INCLUDE_NULL_BEFORE_AND_AFTER` (`include_null_before_and_after`) strategy
4141
*
42-
* <CodeSelector>
42+
* <div data-code-selector>
43+
*
4344
* ```php
4445
* <?php
4546
* // api/src/Entity/Book.php
@@ -111,7 +112,8 @@
111112
* </resource>
112113
* </resources>
113114
* ```
114-
* </CodeSelector>
115+
*
116+
* </div>
115117
*
116118
* Given that the collection endpoint is `/books`, you can filter books by date with the following query: `/books?createdAt[after]=2018-03-19`.
117119
*

‎src/Doctrine/Orm/Filter/ExistsFilter.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@
3030
*
3131
* Syntax: `?exists[property]=<true|false|1|0>`.
3232
*
33-
* <CodeSelector>
33+
* <div data-code-selector>
34+
*
3435
* ```php
3536
* <?php
3637
* // api/src/Entity/Book.php
@@ -102,7 +103,8 @@
102103
* </resource>
103104
* </resources>
104105
* ```
105-
* </CodeSelector>
106+
*
107+
* </div>
106108
*
107109
* Given that the collection endpoint is `/books`, you can filter books with the following query: `/books?exists[comment]=true`.
108110
*

‎src/Doctrine/Orm/Filter/NumericFilter.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
*
2626
* Syntax: `?property=<int|bigint|decimal...>`.
2727
*
28-
* <CodeSelector>
28+
* <div data-code-selector>
29+
*
2930
* ```php
3031
* <?php
3132
* // api/src/Entity/Book.php
@@ -97,7 +98,8 @@
9798
* </resource>
9899
* </resources>
99100
* ```
100-
* </CodeSelector>
101+
*
102+
* </div>
101103
*
102104
* Given that the collection endpoint is `/books`, you can filter books with the following query: `/books?price=10`.
103105
*

‎src/Doctrine/Orm/Filter/OrderFilter.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828
*
2929
* Syntax: `?order[property]=<asc|desc>`.
3030
*
31-
* <CodeSelector>
31+
* <div data-code-selector>
32+
*
3233
* ```php
3334
* <?php
3435
* // api/src/Entity/Book.php
@@ -102,7 +103,8 @@
102103
* </resource>
103104
* </resources>
104105
* ```
105-
* </CodeSelector>
106+
*
107+
* </div>
106108
*
107109
* Given that the collection endpoint is `/books`, you can filter books by title in ascending order and then by ID in descending order with the following query: `/books?order[title]=desc&order[id]=asc`.
108110
*

‎src/Doctrine/Orm/Filter/RangeFilter.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
*
2626
* Syntax: `?property[<lt|gt|lte|gte|between>]=value`.
2727
*
28-
* <CodeSelector>
28+
* <div data-code-selector>
29+
*
2930
* ```php
3031
* <?php
3132
* // api/src/Entity/Book.php
@@ -97,7 +98,8 @@
9798
* </resource>
9899
* </resources>
99100
* ```
100-
* </CodeSelector>
101+
*
102+
* </div>
101103
*
102104
* Given that the collection endpoint is `/books`, you can filter books with the following query: `/books?price[between]=12.99..15.99`.
103105
*

‎src/Doctrine/Orm/Filter/SearchFilter.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@
5656
*
5757
* Syntax: `?property[]=foo&property[]=bar`.
5858
*
59-
* <CodeSelector>
59+
* <div data-code-selector>
60+
*
6061
* ```php
6162
* <?php
6263
* // api/src/Entity/Book.php
@@ -129,7 +130,8 @@
129130
* </resource>
130131
* </resources>
131132
* ```
132-
* </CodeSelector>
133+
*
134+
* </div>
133135
*
134136
* @author Kévin Dunglas <dunglas@gmail.com>
135137
*/

‎src/Elasticsearch/Filter/MatchFilter.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
*
1919
* Syntax: `?property[]=value`.
2020
*
21-
* <CodeSelector>
21+
* <div data-code-selector>
22+
*
2223
* ```php
2324
* <?php
2425
* // api/src/Entity/Book.php
@@ -90,7 +91,8 @@
9091
* </resource>
9192
* </resources>
9293
* ```
93-
* </CodeSelector>
94+
*
95+
* </div>
9496
*
9597
* Given that the collection endpoint is `/books`, you can filter books by title content with the following query: `/books?title=Foundation`.
9698
*

‎src/Elasticsearch/Filter/OrderFilter.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
*
2525
* Syntax: `?order[property]=<asc|desc>`.
2626
*
27-
* <CodeSelector>
27+
* <div data-code-selector>
28+
*
2829
* ```php
2930
* <?php
3031
* // api/src/Entity/Book.php
@@ -97,7 +98,8 @@
9798
* </resource>
9899
* </resources>
99100
* ```
100-
* </CodeSelector>
101+
*
102+
* </div>
101103
*
102104
* Given that the collection endpoint is `/books`, you can filter books by ID and date in ascending or descending order: `/books?order[id]=asc&order[date]=desc`.
103105
*

‎src/Elasticsearch/Filter/TermFilter.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
*
1919
* Syntax: `?property[]=value`.
2020
*
21-
* <CodeSelector>
21+
* <div data-code-selector>
22+
*
2223
* ```php
2324
* <?php
2425
* // api/src/Entity/Book.php
@@ -89,7 +90,8 @@
8990
* </resource>
9091
* </resources>
9192
* ```
92-
* </CodeSelector>
93+
*
94+
* </div>
9395
*
9496
* Given that the collection endpoint is `/books`, you can filter books by title with the following query: `/books?title=Foundation`.
9597
*

‎src/Metadata/ApiProperty.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ public function __construct(
5555
/**
5656
* The `deprecationReason` option deprecates the current operation with a deprecation message.
5757
*
58-
* <CodeSelector>
58+
* <div data-code-selector>
59+
*
5960
* ```php
6061
* <?php
6162
* // api/src/Entity/Review.php
@@ -90,7 +91,8 @@ public function __construct(
9091
* <property resource="App\Entity\Review" name="letter" deprecationReason="Create a Book instead" />
9192
* </properties>
9293
* ```
93-
* </CodeSelector>
94+
*
95+
* </div>
9496
*
9597
* - With JSON-lD / Hydra, [an `owl:deprecated` annotation property](https://www.w3.org/TR/owl2-syntax/#Annotation_Properties) will be added to the appropriate data structure
9698
* - With Swagger / OpenAPI, [a `deprecated` property](https://swagger.io/docs/specification/2-0/paths-and-operations/) will be added

‎src/Metadata/ApiResource.php

+62-34
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ public function __construct(
183183
/**
184184
* The `sunset` option indicates when a deprecated operation will be removed.
185185
*
186-
* <CodeSelector>
186+
* <div data-code-selector>
187187
*
188188
* ```php
189189
* <?php
@@ -218,7 +218,7 @@ public function __construct(
218218
* </resources>
219219
* ```
220220
*
221-
* </CodeSelector>
221+
* </div>
222222
*/
223223
protected ?string $sunset = null,
224224
protected ?string $acceptPatch = null,
@@ -233,7 +233,8 @@ public function __construct(
233233
*
234234
* See: [UrlGeneratorInterface::class](/reference/Api/UrlGeneratorInterface)
235235
*
236-
* <CodeSelector>
236+
* <div data-code-selector>
237+
*
237238
* ```php
238239
* <?php
239240
* // api/src/Entity/Book.php
@@ -265,13 +266,15 @@ public function __construct(
265266
* <resource class="App\Entity\Book" urlGenerationStrategy="0" />
266267
* </resources>
267268
* ```
268-
* </CodeSelector>
269+
*
270+
* </div>
269271
*/
270272
protected ?int $urlGenerationStrategy = null,
271273
/**
272274
* The `deprecationReason` option deprecates the current resource with a deprecation message.
273275
*
274-
* <CodeSelector>
276+
* <div data-code-selector>
277+
*
275278
* ```php
276279
* <?php
277280
* // api/src/Entity/Parchment.php
@@ -303,7 +306,8 @@ public function __construct(
303306
* <resource class="App\Entity\Parchment" deprecationReason="Create a Book instead" />
304307
* </resources>
305308
* ```
306-
* </CodeSelector>
309+
*
310+
* </div>
307311
*
308312
* - With JSON-lD / Hydra, [an `owl:deprecated` annotation property](https://www.w3.org/TR/owl2-syntax/#Annotation_Properties) will be added to the appropriate data structure
309313
* - With Swagger / OpenAPI, [a `deprecated` property](https://swagger.io/docs/specification/2-0/paths-and-operations/) will be added
@@ -331,7 +335,8 @@ public function __construct(
331335
/**
332336
* The `filters` option configures the filters (declared as services) available on the collection routes for the current resource.
333337
*
334-
* <CodeSelector>
338+
* <div data-code-selector>
339+
*
335340
* ```php
336341
* <?php
337342
* // api/src/Entity/Book.php
@@ -366,15 +371,17 @@ public function __construct(
366371
* </resource>
367372
* </resources>
368373
* ```
369-
* </CodeSelector>
374+
*
375+
* </div>
370376
*/
371377
protected ?array $filters = null,
372378
protected ?bool $elasticsearch = null,
373379
protected $mercure = null,
374380
/**
375381
* The `messenger` option dispatches the current resource through the Message Bus.
376382
*
377-
* <CodeSelector>
383+
* <div data-code-selector>
384+
*
378385
* ```php
379386
* <?php
380387
* // api/src/Entity/Book.php
@@ -406,7 +413,8 @@ public function __construct(
406413
* <resource class="App\Entity\Book" messenger=true />
407414
* </resources>
408415
* ```
409-
* </CodeSelector>
416+
*
417+
* </div>
410418
*
411419
* Note: when using `messenger=true` on a Doctrine entity, the Doctrine Processor is not called. If you want it
412420
* to be called, you should [decorate a built-in state processor](/docs/guide/hook-a-persistence-layer-with-a-processor)
@@ -426,7 +434,7 @@ public function __construct(
426434
* By default, items in the collection are ordered in ascending (ASC) order by their resource identifier(s). If you want to
427435
* customize this order, you must add an `order` attribute on your ApiResource annotation:
428436
*
429-
* <CodeSelector>
437+
* <div data-code-selector>
430438
*
431439
* ```php
432440
* <?php
@@ -448,7 +456,7 @@ public function __construct(
448456
* foo: ASC
449457
* ```
450458
*
451-
* </CodeSelector>
459+
* </div>
452460
*
453461
* This `order` attribute is used as an array: the key defines the order field, the values defines the direction.
454462
* If you only specify the key, `ASC` direction will be used as default.
@@ -459,7 +467,8 @@ public function __construct(
459467
/**
460468
* The `paginationClientEnabled` option allows (or disallows) the client to enable (or disable) the pagination for the current resource.
461469
*
462-
* <CodeSelector>
470+
* <div data-code-selector>
471+
*
463472
* ```php
464473
* <?php
465474
* // api/src/Entity/Book.php
@@ -491,7 +500,8 @@ public function __construct(
491500
* <resource class="App\Entity\Book" paginationClientEnabled=true />
492501
* </resources>
493502
* ```
494-
* </CodeSelector>
503+
*
504+
* </div>
495505
*
496506
* The pagination can now be enabled (or disabled) by adding a query parameter named `pagination`:
497507
* - `GET /books?pagination=false`: disabled
@@ -501,7 +511,8 @@ public function __construct(
501511
/**
502512
* The `paginationClientItemsPerPage` option allows (or disallows) the client to set the number of items per page for the current resource.
503513
*
504-
* <CodeSelector>
514+
* <div data-code-selector>
515+
*
505516
* ```php
506517
* <?php
507518
* // api/src/Entity/Book.php
@@ -533,7 +544,8 @@ public function __construct(
533544
* <resource class="App\Entity\Book" paginationClientItemsPerPage=true />
534545
* </resources>
535546
* ```
536-
* </CodeSelector>
547+
*
548+
* </div>
537549
*
538550
* The number of items can now be set by adding a query parameter named `itemsPerPage`:
539551
* - `GET /books?itemsPerPage=50`
@@ -542,7 +554,7 @@ public function __construct(
542554
/**
543555
* The `paginationClientPartial` option allows (or disallows) the client to enable (or disable) the partial pagination for the current resource.
544556
*
545-
* <CodeSelector>
557+
* <div data-code-selector>
546558
*
547559
* ```php
548560
* <?php
@@ -575,7 +587,8 @@ public function __construct(
575587
* <resource class="App\Entity\Book" paginationClientPartial=true />
576588
* </resources>
577589
* ```
578-
* </CodeSelector>
590+
*
591+
* </div>
579592
*
580593
* The partial pagination can now be enabled (or disabled) by adding a query parameter named `partial`:
581594
* - `GET /books?partial=false`: disabled
@@ -587,7 +600,8 @@ public function __construct(
587600
* Select your unique sorted field as well as the direction you'll like the pagination to go via filters.
588601
* Note that for now you have to declare a `RangeFilter` and an `OrderFilter` on the property used for the cursor-based pagination:.
589602
*
590-
* <CodeSelector>
603+
* <div data-code-selector>
604+
*
591605
* ```php
592606
* <?php
593607
* // api/src/Entity/Book.php
@@ -635,15 +649,17 @@ public function __construct(
635649
* </resource>
636650
* </resources>
637651
* ```
638-
* </CodeSelector>
652+
*
653+
* </div>
639654
*
640655
* To know more about cursor-based pagination take a look at [this blog post on medium (draft)](https://medium.com/@sroze/74fd1d324723).
641656
*/
642657
protected ?array $paginationViaCursor = null,
643658
/**
644659
* The `paginationEnabled` option enables (or disables) the pagination for the current resource.
645660
*
646-
* <CodeSelector>
661+
* <div data-code-selector>
662+
*
647663
* ```php
648664
* <?php
649665
* // api/src/Entity/Book.php
@@ -675,7 +691,8 @@ public function __construct(
675691
* <resource class="App\Entity\Book" paginationEnabled=true />
676692
* </resources>
677693
* ```
678-
* </CodeSelector>
694+
*
695+
* </div>
679696
*/
680697
protected ?bool $paginationEnabled = null,
681698
/**
@@ -686,7 +703,8 @@ public function __construct(
686703
* When set to `true`, the Doctrine ORM Paginator will perform an additional query, in order to get the
687704
* correct number of results. You can configure this using the `paginationFetchJoinCollection` option:
688705
*
689-
* <CodeSelector>
706+
* <div data-code-selector>
707+
*
690708
* ```php
691709
* <?php
692710
* // api/src/Entity/Book.php
@@ -718,7 +736,8 @@ public function __construct(
718736
* <resource class="App\Entity\Book" paginationFetchJoinCollection=false />
719737
* </resources>
720738
* ```
721-
* </CodeSelector>
739+
*
740+
* </div>
722741
*
723742
* For more information, please see the [Pagination](https://www.doctrine-project.org/projects/doctrine-orm/en/current/tutorials/pagination.html) entry in the Doctrine ORM documentation.
724743
*/
@@ -731,7 +750,8 @@ public function __construct(
731750
* When set to `true`, the Doctrine ORM Paginator will use output walkers, which are compulsory for some types
732751
* of queries. You can configure this using the `paginationUseOutputWalkers` option:
733752
*
734-
* <CodeSelector>
753+
* <div data-code-selector>
754+
*
735755
* ```php
736756
* <?php
737757
* // api/src/Entity/Book.php
@@ -762,15 +782,17 @@ public function __construct(
762782
* <resource class="App\Entity\Book" paginationUseOutputWalkers=false />
763783
* </resources>
764784
* ```
765-
* </CodeSelector>
785+
*
786+
* </div>
766787
*
767788
* For more information, please see the [Pagination](https://www.doctrine-project.org/projects/doctrine-orm/en/current/tutorials/pagination.html) entry in the Doctrine ORM documentation.
768789
*/
769790
protected ?bool $paginationUseOutputWalkers = null,
770791
/**
771792
* The `paginationItemsPerPage` option defines the number of items per page for the current resource.
772793
*
773-
* <CodeSelector>
794+
* <div data-code-selector>
795+
*
774796
* ```php
775797
* <?php
776798
* // api/src/Entity/Book.php
@@ -801,13 +823,15 @@ public function __construct(
801823
* <resource class="App\Entity\Book" paginationItemsPerPage=30 />
802824
* </resources>
803825
* ```
804-
* </CodeSelector>
826+
*
827+
* </div>
805828
*/
806829
protected ?int $paginationItemsPerPage = null,
807830
/**
808831
* The `paginationMaximumItemsPerPage` option defines the maximum number of items per page for the current resource.
809832
*
810-
* <CodeSelector>
833+
* <div data-code-selector>
834+
*
811835
* ```php
812836
* <?php
813837
* // api/src/Entity/Book.php
@@ -839,13 +863,14 @@ public function __construct(
839863
* </resources>
840864
* ```
841865
*
842-
* </CodeSelector>
866+
* </div>
843867
*/
844868
protected ?int $paginationMaximumItemsPerPage = null,
845869
/**
846870
* The `paginationPartial` option enables (or disables) the partial pagination for the current resource.
847871
*
848-
* <CodeSelector>
872+
* <div data-code-selector>
873+
*
849874
* ```php
850875
* <?php
851876
* // api/src/Entity/Book.php
@@ -876,13 +901,15 @@ public function __construct(
876901
* <resource class="App\Entity\Book" paginationPartial=true />
877902
* </resources>
878903
* ```
879-
* </CodeSelector>
904+
*
905+
* </div>
880906
*/
881907
protected ?bool $paginationPartial = null,
882908
/**
883909
* The `paginationType` option defines the type of pagination (`page` or `cursor`) to use for the current resource.
884910
*
885-
* <CodeSelector>
911+
* <div data-code-selector>
912+
*
886913
* ```php
887914
* <?php
888915
* // api/src/Entity/Book.php
@@ -913,7 +940,8 @@ public function __construct(
913940
* <resource class="App\Entity\Book" paginationType="page" />
914941
* </resources>
915942
* ```
916-
* </CodeSelector>
943+
*
944+
* </div>
917945
*/
918946
protected ?string $paginationType = null,
919947
protected ?string $security = null,

‎src/Metadata/HttpOperation.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ public function __construct(
9494
/**
9595
* The `sunset` option indicates when a deprecated operation will be removed.
9696
*
97-
* <CodeSelector>
97+
* <div data-code-selector>
98+
*
9899
* ```php
99100
* <?php
100101
* // api/src/Entity/Parchment.php
@@ -133,7 +134,8 @@ public function __construct(
133134
* </resource>
134135
* </resources>
135136
* ```
136-
* </CodeSelector>
137+
*
138+
* </div>
137139
*/
138140
protected ?string $sunset = null,
139141
protected ?string $acceptPatch = null,

‎src/Metadata/Operation.php

+56-28
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ public function __construct(
6666
/**
6767
* The `paginationEnabled` option enables (or disables) the pagination for the current collection operation.
6868
*
69-
* <CodeSelector>
69+
* <div data-code-selector>
70+
*
7071
* ```php
7172
* <?php
7273
* // api/src/Entity/Book.php
@@ -104,13 +105,15 @@ public function __construct(
104105
* </resource>
105106
* </resources>
106107
* ```
107-
* </CodeSelector>
108+
*
109+
* </div>
108110
*/
109111
protected ?bool $paginationEnabled = null,
110112
/**
111113
* The `paginationType` option defines the type of pagination (`page` or `cursor`) to use for the current collection operation.
112114
*
113-
* <CodeSelector>
115+
* <div data-code-selector>
116+
*
114117
* ```php
115118
* <?php
116119
* // api/src/Entity/Book.php
@@ -148,13 +151,15 @@ public function __construct(
148151
* </resource>
149152
* </resources>
150153
* ```
151-
* </CodeSelector>
154+
*
155+
* </div>
152156
*/
153157
protected ?string $paginationType = null,
154158
/**
155159
* The `paginationItemsPerPage` option defines the number of items per page for the current collection operation.
156160
*
157-
* <CodeSelector>
161+
* <div data-code-selector>
162+
*
158163
* ```php
159164
* <?php
160165
* // api/src/Entity/Book.php
@@ -191,13 +196,15 @@ public function __construct(
191196
* </resource>
192197
* </resources>
193198
* ```
194-
* </CodeSelector>
199+
*
200+
* </div>
195201
*/
196202
protected ?int $paginationItemsPerPage = null,
197203
/**
198204
* The `paginationMaximumItemsPerPage` option defines the maximum number of items per page for the current resource.
199205
*
200-
* <CodeSelector>
206+
* <div data-code-selector>
207+
*
201208
* ```php
202209
* <?php
203210
* // api/src/Entity/Book.php
@@ -234,13 +241,15 @@ public function __construct(
234241
* </resource>
235242
* </resources>
236243
* ```
237-
* </CodeSelector>
244+
*
245+
* </div>
238246
*/
239247
protected ?int $paginationMaximumItemsPerPage = null,
240248
/**
241249
* The `paginationPartial` option enables (or disables) the partial pagination for the current collection operation.
242250
*
243-
* <CodeSelector>
251+
* <div data-code-selector>
252+
*
244253
* ```php
245254
* <?php
246255
* // api/src/Entity/Book.php
@@ -277,13 +286,15 @@ public function __construct(
277286
* </resource>
278287
* </resources>
279288
* ```
280-
* </CodeSelector>
289+
*
290+
* </div>
281291
*/
282292
protected ?bool $paginationPartial = null,
283293
/**
284294
* The `paginationClientEnabled` option allows (or disallows) the client to enable (or disable) the pagination for the current collection operation.
285295
*
286-
* <CodeSelector>
296+
* <div data-code-selector>
297+
*
287298
* ```php
288299
* <?php
289300
* // api/src/Entity/Book.php
@@ -320,7 +331,8 @@ public function __construct(
320331
* </resource>
321332
* </resources>
322333
* ```
323-
* </CodeSelector>
334+
*
335+
* </div>
324336
*
325337
* The pagination can now be enabled (or disabled) by adding a query parameter named `pagination`:
326338
* - `GET /books?pagination=false`: disabled
@@ -330,7 +342,8 @@ public function __construct(
330342
/**
331343
* The `paginationClientItemsPerPage` option allows (or disallows) the client to set the number of items per page for the current collection operation.
332344
*
333-
* <CodeSelector>
345+
* <div data-code-selector>
346+
*
334347
* ```php
335348
* <?php
336349
* // api/src/Entity/Book.php
@@ -367,7 +380,8 @@ public function __construct(
367380
* </resource>
368381
* </resources>
369382
* ```
370-
* </CodeSelector>
383+
*
384+
* </div>
371385
*
372386
* The number of items can now be set by adding a query parameter named `itemsPerPage`:
373387
* - `GET /books?itemsPerPage=50`
@@ -376,7 +390,8 @@ public function __construct(
376390
/**
377391
* The `paginationClientPartial` option allows (or disallows) the client to enable (or disable) the partial pagination for the current collection operation.
378392
*
379-
* <CodeSelector>
393+
* <div data-code-selector>
394+
*
380395
* ```php
381396
* <?php
382397
* // api/src/Entity/Book.php
@@ -413,7 +428,8 @@ public function __construct(
413428
* </resource>
414429
* </resources>
415430
* ```
416-
* </CodeSelector>
431+
*
432+
* </div>
417433
*
418434
* The partial pagination can now be enabled (or disabled) by adding a query parameter named `partial`:
419435
* - `GET /books?partial=false`: disabled
@@ -428,7 +444,8 @@ public function __construct(
428444
* When set to `true`, the Doctrine ORM Paginator will perform an additional query, in order to get the
429445
* correct number of results. You can configure this using the `paginationFetchJoinCollection` option:
430446
*
431-
* <CodeSelector>
447+
* <div data-code-selector>
448+
*
432449
* ```php
433450
* <?php
434451
* // api/src/Entity/Book.php
@@ -465,7 +482,8 @@ public function __construct(
465482
* </resource>
466483
* </resources>
467484
* ```
468-
* </CodeSelector>
485+
*
486+
* </div>
469487
*
470488
* For more information, please see the [Pagination](https://www.doctrine-project.org/projects/doctrine-orm/en/current/tutorials/pagination.html) entry in the Doctrine ORM documentation.
471489
*/
@@ -478,7 +496,8 @@ public function __construct(
478496
* When set to `true`, the Doctrine ORM Paginator will use output walkers, which are compulsory for some types
479497
* of queries. You can configure this using the `paginationUseOutputWalkers` option:
480498
*
481-
* <CodeSelector>
499+
* <div data-code-selector>
500+
*
482501
* ```php
483502
* <?php
484503
* // api/src/Entity/Book.php
@@ -515,7 +534,8 @@ public function __construct(
515534
* </resource>
516535
* </resources>
517536
* ```
518-
* </CodeSelector>
537+
*
538+
* </div>
519539
*
520540
* For more information, please see the [Pagination](https://www.doctrine-project.org/projects/doctrine-orm/en/current/tutorials/pagination.html) entry in the Doctrine ORM documentation.
521541
*/
@@ -525,7 +545,8 @@ public function __construct(
525545
* Select your unique sorted field as well as the direction you'll like the pagination to go via filters.
526546
* Note that for now you have to declare a `RangeFilter` and an `OrderFilter` on the property used for the cursor-based pagination:.
527547
*
528-
* <CodeSelector>
548+
* <div data-code-selector>
549+
*
529550
* ```php
530551
* <?php
531552
* // api/src/Entity/Book.php
@@ -579,7 +600,8 @@ public function __construct(
579600
* </resource>
580601
* </resources>
581602
* ```
582-
* </CodeSelector>
603+
*
604+
* </div>
583605
*
584606
* To know more about cursor-based pagination take a look at [this blog post on medium (draft)](https://medium.com/@sroze/74fd1d324723).
585607
*/
@@ -598,7 +620,8 @@ public function __construct(
598620
/**
599621
* The `deprecationReason` option deprecates the current operation with a deprecation message.
600622
*
601-
* <CodeSelector>
623+
* <div data-code-selector>
624+
*
602625
* ```php
603626
* <?php
604627
* // api/src/Entity/Parchment.php
@@ -636,7 +659,8 @@ public function __construct(
636659
* </resource>
637660
* </resources>
638661
* ```
639-
* </CodeSelector>
662+
*
663+
* </div>
640664
*
641665
* - With JSON-lD / Hydra, [an `owl:deprecated` annotation property](https://www.w3.org/TR/owl2-syntax/#Annotation_Properties) will be added to the appropriate data structure
642666
* - With Swagger / OpenAPI, [a `deprecated` property](https://swagger.io/docs/specification/2-0/paths-and-operations/) will be added
@@ -646,7 +670,8 @@ public function __construct(
646670
/**
647671
* The `filters` option configures the filters (declared as services) available on the collection routes for the current resource.
648672
*
649-
* <CodeSelector>
673+
* <div data-code-selector>
674+
*
650675
* ```php
651676
* <?php
652677
* // api/src/Entity/Book.php
@@ -687,7 +712,8 @@ public function __construct(
687712
* </resource>
688713
* </resources>
689714
* ```
690-
* </CodeSelector>
715+
*
716+
* </div>
691717
*/
692718
protected ?array $filters = null,
693719
/**
@@ -708,7 +734,8 @@ public function __construct(
708734
/**
709735
* The `messenger` option dispatches the current resource through the Message Bus.
710736
*
711-
* <CodeSelector>
737+
* <div data-code-selector>
738+
*
712739
* ```php
713740
* <?php
714741
* // api/src/Entity/Book.php
@@ -746,7 +773,8 @@ public function __construct(
746773
* </resource>
747774
* </resources>
748775
* ```
749-
* </CodeSelector>
776+
*
777+
* </div>
750778
*
751779
* Note: when using `messenger=true` on a Doctrine entity, the Doctrine Processor is not called. If you want it
752780
* to be called, you should [decorate a built-in state processor](/docs/guide/hook-a-persistence-layer-with-a-processor)

‎src/Serializer/Filter/GroupFilter.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828
* - `overrideDefaultGroups` allows to override the default serialization groups (default: `false`)
2929
* - `whitelist` groups whitelist to avoid uncontrolled data exposure (default: `null` to allow all groups)
3030
*
31-
* <CodeSelector>
31+
* <div data-code-selector>
32+
*
3233
* ```php
3334
* <?php
3435
* // api/src/Entity/Book.php
@@ -102,7 +103,8 @@
102103
* </resource>
103104
* </resources>
104105
* ```
105-
* </CodeSelector>
106+
*
107+
* </div>
106108
*
107109
* Given that the collection endpoint is `/books`, you can filter books by serialization groups with the following query: `/books?groups[]=read&groups[]=write`.
108110
*

‎src/Serializer/Filter/PropertyFilter.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@
3131
* - `overrideDefaultProperties` allows to override the default serialization properties (default: `false`)
3232
* - `whitelist` properties whitelist to avoid uncontrolled data exposure (default: `null` to allow all properties)
3333
*
34-
* <CodeSelector>
34+
* <div data-code-selector>
35+
*
3536
* ```php
3637
* <?php
3738
* // api/src/Entity/Book.php
@@ -105,7 +106,8 @@
105106
* </resource>
106107
* </resources>
107108
* ```
108-
* </CodeSelector>
109+
*
110+
* </div>
109111
*
110112
* Given that the collection endpoint is `/books`, you can filter the serialization properties with the following query: `/books?properties[]=title&properties[]=author`. If you want to include some properties of the nested "author" document, use: `/books?properties[]=title&properties[author][]=name`.
111113
*

0 commit comments

Comments
 (0)
Please sign in to comment.