Skip to content

Commit a55a67d

Browse files
committed
[CS] Fix templates via twig-cs-fixer
1 parent bfc6d08 commit a55a67d

38 files changed

+43
-51
lines changed

src/Autocomplete/templates/autocomplete_form_theme.html.twig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{# EasyAdminAutocomplete form type #}
22
{% block ux_entity_autocomplete_widget %}
33
{% if form.autocomplete is defined %}
4-
{{ form_widget(form.autocomplete, { attr: form.autocomplete.vars.attr|merge({ required: required }) }) }}
4+
{{ form_widget(form.autocomplete, {attr: form.autocomplete.vars.attr|merge({required: required})}) }}
55
{% else %}
66
{{ form_widget(form) }}
77
{% endif %}
@@ -12,4 +12,4 @@
1212
{% set id = form.autocomplete.vars.id %}
1313
{% endif %}
1414
{{ block('form_label') }}
15-
{% endblock ux_entity_autocomplete_label %}
15+
{% endblock ux_entity_autocomplete_label %}

src/Dropzone/templates/form_theme.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{% block dropzone_widget -%}
22
{%- set dataController = (attr['data-controller']|default('') ~ ' symfony--ux-dropzone--dropzone')|trim -%}
3-
{%- set attr = attr|merge({ 'data-controller': '', class: (attr.class|default('') ~ ' dropzone-input')|trim}) -%}
3+
{%- set attr = attr|merge({'data-controller': '', class: (attr.class|default('') ~ ' dropzone-input')|trim}) -%}
44

55
<div class="dropzone-container" data-controller="{{ dataController }}">
66
<input type="file" {{ block('widget_attributes') }} data-symfony--ux-dropzone--dropzone-target="input" />
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
{{ component_url('component1', { prop1: null, prop2: date }) }}
1+
{{ component_url('component1', {prop1: null, prop2: date}) }}
22
{{ component_url('alternate_route') }}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<div{{ attributes }}>
22
Count: {{ this.count }}
3-
</div>
3+
</div>
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{{ component('todo_list', {
22
items: [
3-
{ text: 'milk'},
4-
{ text: 'cheese'},
5-
{ text: 'milk'},
3+
{text: 'milk'},
4+
{text: 'cheese'},
5+
{text: 'milk'},
66
]
77
}) }}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{{ component('todo_list', {
22
items: [
3-
{ text: 'milk'},
4-
{ text: 'cheese'},
5-
{ text: 'milk'},
3+
{text: 'milk'},
4+
{text: 'cheese'},
5+
{text: 'milk'},
66
],
77
includeDataLiveId: true
88
}) }}

src/TwigComponent/templates/Collector/twig_component.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@
139139
{% endfor %}
140140
{% endset %}
141141

142-
{{ include('@WebProfiler/Profiler/toolbar_item.html.twig', { link: profiler_url }) }}
142+
{{ include('@WebProfiler/Profiler/toolbar_item.html.twig', {link: profiler_url}) }}
143143

144144
{% endif %}
145145
{% endblock %}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<twig:Button label='Click me'/>
1+
<twig:Button label='Click me'/>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<twig:Form:SubmitButton label='Submit'/>
1+
<twig:Form:SubmitButton label='Submit'/>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<twig:UserCard :user='user' class='foo'/>
1+
<twig:UserCard :user='user' class='foo'/>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<twig:Button label='Click me' :primary='false'/>
1+
<twig:Button label='Click me' :primary='false'/>

src/TwigComponent/tests/Fixtures/templates/anonymous_component_with_variable_already_in_context.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
<twig:Message>
44
<p>Hey!</p>
5-
</twig:Message>
5+
</twig:Message>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<button{{ attributes.defaults({ class: 'foo', type: 'button' }) }}>Component Content ({{ prop }})</button>
1+
<button{{ attributes.defaults({class: 'foo', type: 'button'}) }}>Component Content ({{ prop }})</button>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<twig:GenericElement element="div" class="divComponent">
2-
{{ outerScope.this.foo }}
2+
{{ outerScope.this.foo }}
33
</twig:GenericElement>
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
{{ component('component_a', { propA: 'prop a value 1', propB: 'prop b value 1' }) }}
2-
{{ component('component_a', { propA: 'prop a value 2', propB: 'prop b value 2' }) }}
3-
{{ component('component_b', { value: 'b value 1', extra: 'value' }) }}
1+
{{ component('component_a', {propA: 'prop a value 1', propB: 'prop b value 1'}) }}
2+
{{ component('component_a', {propA: 'prop a value 2', propB: 'prop b value 2'}) }}
3+
{{ component('component_b', {value: 'b value 1', extra: 'value'}) }}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
<twig:component_a propA propB="hello">
2-
</twig:component_a>
2+
</twig:component_a>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<twig:component_a propA propB='hello'/>
1+
<twig:component_a propA propB='hello'/>

ux.symfony.com/templates/_nav.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<div class="nav-component-img d-flex justify-content-center align-items-center me-2"
1919
style="background: {{ package.color }}">
2020
<img width="10" height="10"
21-
src="{{ asset('images/ux_packages/'~package.imageFilename) }}"
21+
src="{{ asset('images/ux_packages/' ~ package.imageFilename) }}"
2222
alt="Image for the {{ package.humanName }} UX package">
2323
</div>
2424
{{ package.humanName }}

ux.symfony.com/templates/components/CodeBlock.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
</div>
1010
</div>
1111
{% endif %}
12-
<div class="Terminal_body" {{ stimulus_controller('code-expander')}}>
12+
<div class="Terminal_body" {{ stimulus_controller('code-expander') }}>
1313
{% if not showFilename %}
1414
<div class="Terminal_actions">
1515
<twig:CodeBlockButtons source="{{ this.rawSource }}" link="{{ this.githubLink }}"/>

ux.symfony.com/templates/components/DocsLink.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div {{ attributes.defaults({ class: 'DocsLink' }) }}>
1+
<div {{ attributes.defaults({class: 'DocsLink'}) }}>
22
<div class="DocsLink_content">
33
<p class="DocsLink_title ubuntu-header">
44
<a href="{{ url }}" class="DocsLink_link"

ux.symfony.com/templates/components/HomepageTerminalSwapper.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<div {{ attributes.defaults({
22
class: 'homepage-terminal-swapper'
33
}) }}>
4-
{% component Terminal with { height: '180px', bottomPadding: 0, processContents: false } %}
4+
{% component Terminal with {height: '180px', bottomPadding: 0, processContents: false} %}
55
{% block content -%}
66
<span
77
style="font-size: 1.2em;"

ux.symfony.com/templates/components/Icon.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{% set default_attributes = {
2-
'class': 'Icon Icon--'~name,
2+
'class': 'Icon Icon--' ~ name,
33
'role': 'img',
44
'aria-hidden': 'true',
55
'aria-label': label,

ux.symfony.com/templates/components/InvoiceCreator.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@
113113
</button>
114114
{% if saveFailed %}
115115
<small class="text-secondary">Check above for errors</small>
116-
{% endif %}
116+
{% endif %}
117117
{% if areAnyLineItemsEditing %}
118118
<small class="text-secondary">Save all line items before continuing.</small>
119119
{% endif %}

ux.symfony.com/templates/components/NewProductForm.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
</div>
8080
</form>
8181

82-
{% component BootstrapModal with { id: 'new-category-modal' } %}
82+
{% component BootstrapModal with {id: 'new-category-modal'} %}
8383
{% block modal_header %}
8484
<h5>Add a Category</h5>
8585
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>

ux.symfony.com/templates/components/PackageBox.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<div class="PackageBox" style="--gradient: {{ package.gradient }};--color: {{ package.color }};">
22

33
<div class="PackageBox_logo">
4-
<img width="36" height="36" src="{{ asset('images/ux_packages/'~package.imageFilename) }}"
4+
<img width="36" height="36" src="{{ asset('images/ux_packages/' ~ package.imageFilename) }}"
55
alt="Image for the {{ package.humanName }} UX package">
66
</div>
77

ux.symfony.com/templates/components/TodoListForm.html.twig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@
3939
}) }}
4040
</td>
4141
<td>
42-
{{ form_row(itemForm.vars.button_delete, { label: 'X', attr: { class: 'btn btn-outline-danger' } }) }}
42+
{{ form_row(itemForm.vars.button_delete, {label: 'X', attr: {class: 'btn btn-outline-danger'}}) }}
4343
</td>
4444
</tr>
4545
{% endfor %}
4646
</tbody>
4747
</table>
4848

49-
{{ form_widget(form.todoItems.vars.button_add, { label: '+ Add Item', attr: { class: 'btn btn-outline-primary' } }) }}
49+
{{ form_widget(form.todoItems.vars.button_add, {label: '+ Add Item', attr: {class: 'btn btn-outline-primary'}}) }}
5050

5151
<button type="submit" class="btn btn-success" formnovalidate>Save</button>
5252
{{ form_end(form) }}

ux.symfony.com/templates/demos/live_component/form_collection_type.html.twig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,3 @@
1111
{% block demo_content %}
1212
<twig:TodoListForm :form="form" :todoList="todoList" />
1313
{% endblock %}
14-

ux.symfony.com/templates/demos/live_component/product_form.html.twig

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ the new `Category` to the database and then does two important things:
3636
(see `bootstrap-modal-controller.js`).
3737
</twig:CodeWithExplanationRow>
3838

39-
4039
<twig:TabbedCodeBlocks :files="[
4140
'src/Twig/BootstrapModal.php',
4241
'templates/components/BootstrapModal.html.twig',
@@ -49,7 +48,7 @@ the new `Category` to the database and then does two important things:
4948
{% endblock %}
5049

5150
{% block code_block_right %}
52-
{% component CodeBlock with { filename: 'templates/components/InlineEditFood.html.twig', height: '400px' } %}
51+
{% component CodeBlock with {filename: 'templates/components/InlineEditFood.html.twig', height: '400px'} %}
5352
{% block content %}
5453
{{- source('components/InlineEditFood.html.twig') -}}
5554
{% endblock %}

ux.symfony.com/templates/main/_package_in_list.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div class="components-container p-2">
33
<div class="d-flex">
44
<div class="live-component-img d-flex justify-content-center align-items-center" style="background: {{ package.gradient }}, {{ package.color }}">
5-
<img width="17px" height="17px" src="{{ asset('images/ux_packages/'~package.imageFilename) }}" alt="Image for the {{ package.humanName }} UX package">
5+
<img width="17px" height="17px" src="{{ asset('images/ux_packages/' ~ package.imageFilename) }}" alt="Image for the {{ package.humanName }} UX package">
66
</div>
77
<h4 class="ubuntu-title ps-2 align-self-center">{{ package.humanName }}</h4>
88
</div>

ux.symfony.com/templates/main/homepage.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
<p class="eyebrows" style="margin-top: 111px;">Packages</p>
9595
<div class="d-md-flex justify-content-md-between text-center align-items-center text-md-start">
9696
<h2 class="ubuntu pt-2 component-headlines">Install extra <em class="rainbow-emphasis">Packages</em></h2>
97-
<a style="height: 100%;" class="btn btn-md btn-outline-primary mt-3 mt-md-0" href="{{ path('app_packages')}}">
97+
<a style="height: 100%;" class="btn btn-md btn-outline-primary mt-3 mt-md-0" href="{{ path('app_packages') }}">
9898
Browse all Packages
9999
<twig:Icon name="arrow-right" style="transform: rotate(-45deg);"/>
100100
</a>

ux.symfony.com/templates/packageBase.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{% extends 'base.html.twig' %}
22

3-
{#{% set package = twigPackageHelper.currentPackage() %}#}
3+
{# {% set package = twigPackageHelper.currentPackage() %} #}
44
{% block title %}{{ package.humanName }} | Symfony UX Packages{% endblock %}
55

66
{% block header %}

ux.symfony.com/templates/ux_packages/_package_install.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<h2 class="ubuntu text-center mt-5">Install It</h2>
33
<div class="d-flex justify-content-center mt-5">
44
<div class="col-12 col-md-6">
5-
{% component Terminal with { bottomPadding: 20 } %}
5+
{% component Terminal with {bottomPadding: 20} %}
66
{% block content %}
77
composer require {{ package.composerName }}
88
npm install --force

ux.symfony.com/templates/ux_packages/cropperjs.html.twig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,3 @@
5959
</div>
6060
{% endif %}
6161
{% endblock %}
62-

ux.symfony.com/templates/ux_packages/notify.html.twig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,3 @@
3838
<button type="submit" class="btn btn-primary">Send Notification</button>
3939
{{ form_end(form) }}
4040
{% endblock %}
41-

ux.symfony.com/templates/ux_packages/turbo.html.twig

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
courtesy of <a class="font-white text-underline" href="https://turbo.hotwired.dev/" rel="external noopener noreferrer">Turbo</a>
1515

1616
<div style="position: absolute; bottom: 4rem; left: 50%; transform: translateX(-50%);">
17-
{{ include('ux_packages/turbo/_chatMessageCount.html.twig', {messageCount: this.messageCount }) }}
17+
{{ include('ux_packages/turbo/_chatMessageCount.html.twig', {messageCount: this.messageCount}) }}
1818
</div>
1919
{% endblock %}
2020

@@ -54,13 +54,13 @@
5454
<div class="d-flex justify-content-between">
5555
<div class="flex-grow-1">
5656
{{ form_row(form.name, {
57-
row_attr: { class: 'form-floating' },
58-
attr: { placeholder: 'Enter a name' },
57+
row_attr: {class: 'form-floating'},
58+
attr: {placeholder: 'Enter a name'},
5959
}) }}
6060
</div>
6161
<div class="flex-grow-1 ms-2">
6262
{{ form_row(form.animal, {
63-
row_attr: { class: 'form-floating' },
63+
row_attr: {class: 'form-floating'},
6464
}) }}
6565
</div>
6666
</div>
@@ -145,4 +145,3 @@
145145

146146
</div>
147147
{% endblock %}
148-

ux.symfony.com/templates/ux_packages/turbo/add_todo.html.twig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,3 @@
2020
</form>
2121
</turbo-frame>
2222
{% endblock %}
23-

ux.symfony.com/templates/ux_packages/turbo/todos.html.twig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,3 @@
2626
<a class="btn btn-dark mt-5" style="width: 100%;" href="{{ path('app_turbo_add_todo_item') }}">+ Add another item</a>
2727
</turbo-frame>
2828
{% endblock %}
29-

ux.symfony.com/templates/ux_packages/typed.html.twig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,3 @@
4343
></span>
4444
</div>
4545
{% endblock %}
46-

0 commit comments

Comments
 (0)