Skip to content

Commit

Permalink
Fix Twig-related deprecations in templates
Browse files Browse the repository at this point in the history
  • Loading branch information
Kreyu committed Jan 12, 2025
1 parent 4b19800 commit 6a5ad64
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 75 deletions.
64 changes: 32 additions & 32 deletions src/Resources/views/data_collector/template.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -251,35 +251,35 @@
</div>
</div>

<div class="tab{{ data_table.value_rows ?? [] is empty ? ' disabled' }}">
<div class="tab{{ data_table.value_rows|default([]) is empty ? ' disabled' }}">
<h3 class="tab-title">Value Rows</h3>

<div class="tab-content">
{{ _self.render_value_rows(data_table) }}
</div>
</div>

<div class="tab{{ data_table.passed_options ?? [] is empty ? ' disabled' }}">
<div class="tab{{ data_table.passed_options|default([]) is empty ? ' disabled' }}">
<h3 class="tab-title">Passed Options</h3>

<div class="tab-content">
{{ _self.render_passed_options(data_table, 'data table') }}
</div>
</div>

<div class="tab{{ data_table.resolved_options ?? [] is empty ? ' disabled' }}">
<div class="tab{{ data_table.resolved_options|default([]) is empty ? ' disabled' }}">
<h3 class="tab-title">Resolved Options</h3>

<div class="tab-content">
{{ _self.render_resolved_options(data_table) }}
</div>
</div>

<div class="tab{{ data_table.view_vars ?? [] is empty ? ' disabled' }}">
<div class="tab{{ data_table.view_vars|default([]) is empty ? ' disabled' }}">
<h3 class="tab-title">View Vars</h3>

<div class="tab-content">
{{ _self.render_view_variables(data_table.view_vars ?? []) }}
{{ _self.render_view_variables(data_table.view_vars|default([])) }}
</div>
</div>
</div>
Expand All @@ -304,35 +304,35 @@
</div>
</div>

<div class="tab{{ column.passed_options ?? [] is empty ? ' disabled' }}">
<div class="tab{{ column.passed_options|default([]) is empty ? ' disabled' }}">
<h3 class="tab-title">Passed Options</h3>

<div class="tab-content">
{{ _self.render_passed_options(column, 'column') }}
</div>
</div>

<div class="tab{{ column.resolved_options ?? [] is empty ? ' disabled' }}">
<div class="tab{{ column.resolved_options|default([]) is empty ? ' disabled' }}">
<h3 class="tab-title">Resolved Options</h3>

<div class="tab-content">
{{ _self.render_resolved_options(column) }}
</div>
</div>

<div class="tab{{ column.header_view_vars ?? [] is empty ? ' disabled' }}">
<div class="tab{{ column.header_view_vars|default([]) is empty ? ' disabled' }}">
<h3 class="tab-title">Header View Vars</h3>

<div class="tab-content">
{{ _self.render_view_variables(column.header_view_vars ?? []) }}
{{ _self.render_view_variables(column.header_view_vars|default([])) }}
</div>
</div>

<div class="tab{{ column.value_view_vars ?? [] is empty ? ' disabled' }}">
<div class="tab{{ column.value_view_vars|default([]) is empty ? ' disabled' }}">
<h3 class="tab-title">Value View Vars</h3>

<div class="tab-content">
{{ _self.render_view_variables(column.value_view_vars ?? []) }}
{{ _self.render_view_variables(column.value_view_vars|default([])) }}
</div>
</div>
</div>
Expand All @@ -358,27 +358,27 @@
</div>
</div>

<div class="tab{{ filter.passed_options ?? [] is empty ? ' disabled' }}">
<div class="tab{{ filter.passed_options|default([]) is empty ? ' disabled' }}">
<h3 class="tab-title">Passed Options</h3>

<div class="tab-content">
{{ _self.render_passed_options(filter, 'filter') }}
</div>
</div>

<div class="tab{{ filter.resolved_options ?? [] is empty ? ' disabled' }}">
<div class="tab{{ filter.resolved_options|default([]) is empty ? ' disabled' }}">
<h3 class="tab-title">Resolved Options</h3>

<div class="tab-content">
{{ _self.render_resolved_options(filter) }}
</div>
</div>

<div class="tab{{ filter.view_vars ?? [] is empty ? ' disabled' }}">
<div class="tab{{ filter.view_vars|default([]) is empty ? ' disabled' }}">
<h3 class="tab-title">View Vars</h3>

<div class="tab-content">
{{ _self.render_view_variables(filter.view_vars ?? []) }}
{{ _self.render_view_variables(filter.view_vars|default([])) }}
</div>
</div>
</div>
Expand All @@ -396,27 +396,27 @@
</div>

<div class="sf-tabs">
<div class="tab {{ action.passed_options ?? [] is empty ? 'disabled' }}">
<div class="tab {{ action.passed_options|default([]) is empty ? 'disabled' }}">
<h3 class="tab-title">Passed Options</h3>

<div class="tab-content">
{{ _self.render_passed_options(action, 'action') }}
</div>
</div>

<div class="tab {{ action.resolved_options ?? [] is empty ? 'disabled' }}">
<div class="tab {{ action.resolved_options|default([]) is empty ? 'disabled' }}">
<h3 class="tab-title">Resolved Options</h3>

<div class="tab-content">
{{ _self.render_resolved_options(action) }}
</div>
</div>

<div class="tab {{ action.view_vars ?? [] is empty ? 'disabled' }}">
<div class="tab {{ action.view_vars|default([]) is empty ? 'disabled' }}">
<h3 class="tab-title">View Vars</h3>

<div class="tab-content">
{{ _self.render_view_variables(action.view_vars ?? []) }}
{{ _self.render_view_variables(action.view_vars|default([])) }}
</div>
</div>
</div>
Expand All @@ -434,27 +434,27 @@
</div>

<div class="sf-tabs">
<div class="tab {{ action.passed_options ?? [] is empty ? 'disabled' }}">
<div class="tab {{ action.passed_options|default([]) is empty ? 'disabled' }}">
<h3 class="tab-title">Passed Options</h3>

<div class="tab-content">
{{ _self.render_passed_options(action, 'row action') }}
</div>
</div>

<div class="tab {{ action.resolved_options ?? [] is empty ? 'disabled' }}">
<div class="tab {{ action.resolved_options|default([]) is empty ? 'disabled' }}">
<h3 class="tab-title">Resolved Options</h3>

<div class="tab-content">
{{ _self.render_resolved_options(action) }}
</div>
</div>

<div class="tab {{ action.view_vars ?? [] is empty ? 'disabled' }}">
<div class="tab {{ action.view_vars|default([]) is empty ? 'disabled' }}">
<h3 class="tab-title">View Vars</h3>

<div class="tab-content">
{{ _self.render_view_variables(action.view_vars ?? []) }}
{{ _self.render_view_variables(action.view_vars|default([])) }}
</div>
</div>
</div>
Expand All @@ -472,27 +472,27 @@
</div>

<div class="sf-tabs">
<div class="tab {{ action.passed_options ?? [] is empty ? 'disabled' }}">
<div class="tab {{ action.passed_options|default([]) is empty ? 'disabled' }}">
<h3 class="tab-title">Passed Options</h3>

<div class="tab-content">
{{ _self.render_passed_options(action, 'batch action') }}
</div>
</div>

<div class="tab {{ action.resolved_options ?? [] is empty ? 'disabled' }}">
<div class="tab {{ action.resolved_options|default([]) is empty ? 'disabled' }}">
<h3 class="tab-title">Resolved Options</h3>

<div class="tab-content">
{{ _self.render_resolved_options(action) }}
</div>
</div>

<div class="tab {{ action.view_vars ?? [] is empty ? 'disabled' }}">
<div class="tab {{ action.view_vars|default([]) is empty ? 'disabled' }}">
<h3 class="tab-title">View Vars</h3>

<div class="tab-content">
{{ _self.render_view_variables(action.view_vars ?? []) }}
{{ _self.render_view_variables(action.view_vars|default([])) }}
</div>
</div>
</div>
Expand All @@ -510,15 +510,15 @@
</div>

<div class="sf-tabs">
<div class="tab {{ exporter.passed_options ?? [] is empty ? 'disabled' }}">
<div class="tab {{ exporter.passed_options|default([]) is empty ? 'disabled' }}">
<h3 class="tab-title">Passed Options</h3>

<div class="tab-content">
{{ _self.render_passed_options(exporter, 'exporter') }}
</div>
</div>

<div class="tab {{ exporter.resolved_options ?? [] is empty ? 'disabled' }}">
<div class="tab {{ exporter.resolved_options|default([]) is empty ? 'disabled' }}">
<h3 class="tab-title">Resolved Options</h3>

<div class="tab-content">
Expand Down Expand Up @@ -691,7 +691,7 @@
{% endmacro %}

{% macro render_value_rows(data) %}
{% if data.value_rows ?? [] is not empty %}
{% if data.value_rows|default([]) is not empty %}
<table>
<thead>
<tr>
Expand Down Expand Up @@ -748,7 +748,7 @@
{% endmacro %}

{% macro render_passed_options(data, label) %}
{% if data.passed_options ?? [] is not empty %}
{% if data.passed_options|default([]) is not empty %}
<table>
<thead>
<tr>
Expand Down Expand Up @@ -792,7 +792,7 @@
</tr>
</thead>
<tbody>
{% for option, value in data.resolved_options ?? [] %}
{% for option, value in data.resolved_options|default([]) %}
<tr>
<th scope="row">{{ option }}</th>
<td>{{ profiler_dump(value, 1) }}</td>
Expand Down
Loading

0 comments on commit 6a5ad64

Please sign in to comment.