Skip to content

Commit 86c97ca

Browse files
authored
fix(symfony): symfony 7.2 deprecations (#6835)
1 parent 4d7deea commit 86c97ca

File tree

7 files changed

+62
-67
lines changed

7 files changed

+62
-67
lines changed

src/Elasticsearch/Serializer/NameConverter/InnerFieldsNameConverter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
*
2525
* @author Baptiste Meyer <[email protected]>
2626
*/
27-
final class InnerFieldsNameConverter implements AdvancedNameConverterInterface
27+
final class InnerFieldsNameConverter implements NameConverterInterface, AdvancedNameConverterInterface
2828
{
2929
public function __construct(private readonly NameConverterInterface $inner = new CamelCaseToSnakeCaseNameConverter())
3030
{

src/JsonApi/Serializer/ReservedAttributeNameConverter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
*
2222
* @author Baptiste Meyer <[email protected]>
2323
*/
24-
final class ReservedAttributeNameConverter implements AdvancedNameConverterInterface
24+
final class ReservedAttributeNameConverter implements NameConverterInterface, AdvancedNameConverterInterface
2525
{
2626
public const JSON_API_RESERVED_ATTRIBUTES = [
2727
'id' => '_id',

src/Symfony/Bundle/Resources/config/doctrine_mongodb_odm.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@
154154
<service id="api_platform.doctrine_mongodb.odm.state.collection_provider" class="ApiPlatform\Doctrine\Odm\State\CollectionProvider" public="false">
155155
<argument type="service" id="api_platform.metadata.resource.metadata_collection_factory" />
156156
<argument type="service" id="doctrine_mongodb" />
157-
<argument type="tagged" tag="api_platform.doctrine_mongodb.odm.aggregation_extension.collection" />
157+
<argument type="tagged_iterator" tag="api_platform.doctrine_mongodb.odm.aggregation_extension.collection" />
158158
<argument type="tagged_locator" tag="api_platform.doctrine.odm.links_handler" index-by="key" />
159159

160160
<tag name="api_platform.state_provider" priority="-100" key="ApiPlatform\Doctrine\Odm\State\CollectionProvider" />
@@ -165,7 +165,7 @@
165165
<service id="api_platform.doctrine_mongodb.odm.state.item_provider" class="ApiPlatform\Doctrine\Odm\State\ItemProvider" public="false">
166166
<argument type="service" id="api_platform.metadata.resource.metadata_collection_factory" />
167167
<argument type="service" id="doctrine_mongodb" />
168-
<argument type="tagged" tag="api_platform.doctrine_mongodb.odm.aggregation_extension.item" />
168+
<argument type="tagged_iterator" tag="api_platform.doctrine_mongodb.odm.aggregation_extension.item" />
169169
<argument type="tagged_locator" tag="api_platform.doctrine.odm.links_handler" index-by="key" />
170170

171171
<tag name="api_platform.state_provider" priority="-100" key="ApiPlatform\Doctrine\Odm\State\ItemProvider" />

src/Symfony/Bundle/Resources/views/DataCollector/request.html.twig

Lines changed: 53 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -139,67 +139,62 @@
139139
</div>
140140
</div>
141141
{% if dataCollected.resourceMetadataCollection is not empty %}
142-
<div class="sf-tabs">
143-
<div class="tab">
144-
<h3 class="tab-title metadata-tab-title">Metadata</h3>
145-
<h3>Resources</h3>
146-
<div class="tab-content metadata-tab-content">
147-
<div class="sf-tabs">
148-
{% for resourceMetadata in dataCollected.resourceMetadataCollection %}
149-
<div class="tab">
150-
<h3 class="tab-title">
151-
{{ resourceMetadata.resource.uriTemplate ?? resourceMetadata.resource.shortName }}
152-
</h3>
153-
<div class="tab-content">
154-
<table>
155-
<thead>
156-
<tr>
157-
<th scope="col" class="key">Resource</th>
158-
</tr>
159-
</thead>
160-
<tbody>
161-
<tr>
162-
<td>{{- profiler_dump(resourceMetadata.resource, 1) -}}</td>
163-
</tr>
164-
</tbody>
165-
</table>
166-
{{ apiPlatform.operationTable(resourceMetadata.operations, '', dataCollected.requestAttributes.operation_name|default('')) }}
167-
<table>
168-
<thead>
169-
<tr>
170-
<th scope="col" class="key">Filters</th>
171-
<th scope="col"></th>
172-
</tr>
173-
</thead>
174-
<tbody>
175-
{% if dataCollected.filters and loop.index0 in dataCollected.filters|keys %}
176-
{% for id, filter in dataCollected.filters[loop.index0] %}
177-
{% set ignored_filter = filter is same as(null) %}
178-
<tr{% if ignored_filter %} class="status-warning"{% endif %}>
179-
<td>
180-
{{ id }}
181-
{% if ignored_filter %}
182-
<span class="newline text-muted">ignored filter</span>
183-
{% else %}
184-
{{ dump(filter) }}
185-
{% endif %}
186-
</td>
187-
</tr>
188-
{% endfor %}
189-
{% else %}
190-
<tr>
191-
<td class="text-muted" colspan="2">
192-
No available filter declared for this resource.
142+
<h3>Resources</h3>
143+
<div class="tab-content metadata-tab-content">
144+
<div class="sf-tabs">
145+
{% for resourceMetadata in dataCollected.resourceMetadataCollection %}
146+
<div class="tab">
147+
<h3 class="tab-title">
148+
{{ resourceMetadata.resource.uriTemplate ?: resourceMetadata.resource.shortName }}
149+
</h3>
150+
<div class="tab-content">
151+
<table>
152+
<thead>
153+
<tr>
154+
<th scope="col" class="key">Resource</th>
155+
</tr>
156+
</thead>
157+
<tbody>
158+
<tr>
159+
<td>{{- profiler_dump(resourceMetadata.resource, 1) -}}</td>
160+
</tr>
161+
</tbody>
162+
</table>
163+
{{ apiPlatform.operationTable(resourceMetadata.operations, '', dataCollected.requestAttributes.operation_name|default('')) }}
164+
<table>
165+
<thead>
166+
<tr>
167+
<th scope="col" class="key">Filters</th>
168+
<th scope="col"></th>
169+
</tr>
170+
</thead>
171+
<tbody>
172+
{% if dataCollected.filters and loop.index0 in dataCollected.filters|keys %}
173+
{% for id, filter in dataCollected.filters[loop.index0] %}
174+
{% set ignored_filter = filter is same as(null) %}
175+
<tr{% if ignored_filter %} class="status-warning"{% endif %}>
176+
<td>
177+
{{ id }}
178+
{% if ignored_filter %}
179+
<span class="newline text-muted">ignored filter</span>
180+
{% else %}
181+
{{ dump(filter) }}
182+
{% endif %}
193183
</td>
194184
</tr>
195-
{% endif %}
196-
</tbody>
197-
</table>
198-
</div>
199-
</div>
200-
{% endfor %}
185+
{% endfor %}
186+
{% else %}
187+
<tr>
188+
<td class="text-muted" colspan="2">
189+
No available filter declared for this resource.
190+
</td>
191+
</tr>
192+
{% endif %}
193+
</tbody>
194+
</table>
195+
</div>
201196
</div>
202-
</div>
197+
{% endfor %}
203198
</div>
204199
</div>
205200
{% endif %}

tests/.ignored-deprecations

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,4 @@
3030
%Since api-platform/core 3.4: Injecting the "ApiPlatform\\JsonSchema\\TypeFactoryInterface" inside "ApiPlatform\\OpenApi\\Factory\\OpenApiFactory" is deprecated and "ApiPlatform\\JsonSchema\\TypeFactoryInterface" will be removed in 4.x.%
3131
%Since api-platform/core 3.3: Use a "ApiPlatform\\State\\ProviderInterface" as first argument in "ApiPlatform\\Symfony\\EventListener\\QueryParameterValidateListener" instead of "ApiPlatform\\ParameterValidator\\ParameterValidator".%
3232
%Use quoteSingleIdentifier\(\) individually for each part of a qualified name instead.%
33+
%class implements "Symfony\\Component\\Serializer\\NameConverter\\AdvancedNameConverterInterface" that is deprecated since Symfony 7.2, use NameConverterInterface instead.%

tests/.ignored-deprecations-legacy-events

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,4 @@
2828
%Since symfony/validator 7.1: Not passing a value for the "requireTld" option to the Url constraint is deprecated. Its default value will change to "true".%
2929
%Since api-platform/core 3.4: Injecting the "ApiPlatform\\JsonSchema\\TypeFactoryInterface" inside "ApiPlatform\\JsonSchema\\SchemaFactory" is deprecated and "ApiPlatform\\JsonSchema\\TypeFactoryInterface" will be removed in 4.x.%
3030
%Since api-platform/core 3.4: Injecting the "ApiPlatform\\JsonSchema\\TypeFactoryInterface" inside "ApiPlatform\\OpenApi\\Factory\\OpenApiFactory" is deprecated and "ApiPlatform\\JsonSchema\\TypeFactoryInterface" will be removed in 4.x.%
31+
%class implements "Symfony\\Component\\Serializer\\NameConverter\\AdvancedNameConverterInterface" that is deprecated since Symfony 7.2, use NameConverterInterface instead.%

tests/Symfony/Bundle/Twig/ApiPlatformProfilerPanelTest.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -147,14 +147,12 @@ public function testProfilerGeneralLayout(): void
147147
$this->assertCount(1, $metrics->filter('.metric'), 'The should be one metric displayed (resource class).');
148148
$this->assertSame('mongodb' === $this->env ? DocumentDummy::class : Dummy::class, $metrics->filter('span.value')->html());
149149

150-
$this->assertCount(4, $crawler->filter('.sf-tabs .tab-content'), 'Tabs must be presents on the panel.');
150+
$this->assertCount(3, $crawler->filter('.sf-tabs .tab-content'), 'Tabs must be presents on the panel.');
151151

152-
// Metadata tab
153-
$this->assertSame('Metadata', $crawler->filter('.tab:nth-of-type(1) .tab-title')->html());
154-
$tabContent = $crawler->filter('.tab:nth-of-type(1) .tab-content');
152+
$tabContent = $crawler->filter('.tab:nth-of-type(1)');
155153
$this->assertStringEndsWith('Dummy', trim($tabContent->filter('h3')->html()), 'the resource shortname should be displayed.');
156154

157-
$this->assertCount(9, $tabContent->filter('table'));
155+
$this->assertCount(3, $tabContent->filter('table'));
158156
$this->assertSame('Resource', $tabContent->filter('table:first-of-type thead th:first-of-type')->html());
159157
$this->assertSame('Operations', $tabContent->filter('table:nth-of-type(2) thead th:first-of-type')->html());
160158
$this->assertSame('Filters', $tabContent->filter('table:nth-of-type(3) thead th:first-of-type')->html());

0 commit comments

Comments
 (0)