Skip to content

Commit

Permalink
Merge pull request #795 from KnpLabs/fix-twig-cs
Browse files Browse the repository at this point in the history
fix coding standard in templates
  • Loading branch information
garak authored Jul 2, 2024
2 parents a9cbcb3 + 695797f commit cf9d768
Show file tree
Hide file tree
Showing 12 changed files with 30 additions and 15 deletions.
17 changes: 16 additions & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,22 @@ jobs:
uses: actions/checkout@v4
- name: Run PHP-CS-Fixer
uses: docker://oskarstark/php-cs-fixer-ga

twig-cs-fixer:
runs-on: ubuntu-22.04
name: Twig-CS-Fixer
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Require the vendor
run: composer require --dev --no-update vincentlanglet/twig-cs-fixer ^2.11
- name: Update
run: composer update --no-interaction --no-progress
- name: Run
run: vendor/bin/twig-cs-fixer lint templates

tests:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
strategy:
matrix:
php:
Expand All @@ -38,6 +52,7 @@ jobs:
symfony:
- '6.4.*'
- '7.0.*'
- '7.1.*'
include:
- php: '8.1'
symfony: '6.4.*'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* Overview: https://icons.getbootstrap.com/
*/
#}
<a{% for attr, value in options %} {{ attr }}="{{ value }}"{% endfor %}>
<a{% for attr, value in options %} {{ attr }}="{{ value }}"{% endfor %}>
<span class="float-end">
{% if sorted %}
{% if direction == 'desc' %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Bootstrap v5 with Font Awesome Sorting control implementation.
*/
#}
<a{% for attr, value in options %} {{ attr }}="{{ value }}"{% endfor %}>
<a{% for attr, value in options %} {{ attr }}="{{ value }}"{% endfor %}>
<span class="float-end">
{% if sorted %}
{% if direction == 'desc' %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* Overview: https://material.io/resources/icons/?style=baseline
*/
#}
<a{% for attr, value in options %} {{ attr }}="{{ value }}"{% endfor %}>
<a{% for attr, value in options %} {{ attr }}="{{ value }}"{% endfor %}>
<span class="float-end">
{% if sorted %}
{% if direction == 'desc' %}
Expand Down
4 changes: 2 additions & 2 deletions templates/Pagination/foundation_v5_pagination.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @file
* Foundation 5 Sliding pagination control implementation.
*
* View that can be used with the pagination module
* View that can be used with the pagination module
* from the Foundation 5 CSS Toolkit
* https://get.foundation/sites/docs-v5/components/pagination.html
*
Expand Down Expand Up @@ -70,7 +70,7 @@
{% else %}
<li>
<a href="{{ path(route, query|merge({(pageParameterName): (pageCount - 1)})) }}">
{{ pageCount -1 }}
{{ pageCount - 1 }}
</a>
</li>
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion templates/Pagination/foundation_v6_pagination.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
{% else %}
<li>
<a href="{{ path(route, query|merge({(pageParameterName): (pageCount - 1)})) }}">
{{ pageCount -1 }}
{{ pageCount - 1 }}
</a>
</li>
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion templates/Pagination/semantic_ui_sortable_link.html.twig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<a{% for attr, value in options %} {{ attr }}="{{ value }}"{% endfor %}>
<a{% for attr, value in options %} {{ attr }}="{{ value }}"{% endfor %}>
<span class="right floated">
{% if sorted %}
{% if direction == 'desc' %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @author Rodrigo Régis Palmeira <[email protected]>
*/
#}
<a{% for attr, value in options %} {{ attr }}="{{ value }}"{% endfor %}>
<a{% for attr, value in options %} {{ attr }}="{{ value }}"{% endfor %}>
<span class="float-right">
{% if sorted %}
{% if direction == 'desc' %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* @author Mike Stuebbe <[email protected]>
*/
#}
<a{% for attr, value in options %} {{ attr }}="{{ value }}"{% endfor %}>
<a{% for attr, value in options %} {{ attr }}="{{ value }}"{% endfor %}>
<span class="float-right">
{% if sorted %}
{% if direction == 'desc' %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
#}
{% if pageCount > 1 %}
<nav>
{% set classAlign = (align is not defined) ? '' : align=='center' ? ' justify-content-center' : (align=='right' ? ' justify-content-end' : '') %}
{% set classSize = (size is not defined) ? '' : size=='large' ? ' pagination-lg' : (size=='small' ? ' pagination-sm' : '') %}
{% set classAlign = (align is not defined) ? '' : align == 'center' ? ' justify-content-center' : (align == 'right' ? ' justify-content-end' : '') %}
{% set classSize = (size is not defined) ? '' : size == 'large' ? ' pagination-lg' : (size == 'small' ? ' pagination-sm' : '') %}
<ul class="pagination{{ classAlign }}{{ classSize }}">

{% if previous is defined %}
Expand Down Expand Up @@ -61,7 +61,7 @@
</li>
{% else %}
<li class="page-item">
<a class="page-link" href="{{ path(route, query|merge({(pageParameterName): (pageCount - 1)})) }}">{{ pageCount -1 }}</a>
<a class="page-link" href="{{ path(route, query|merge({(pageParameterName): (pageCount - 1)})) }}">{{ pageCount - 1 }}</a>
</li>
{% endif %}
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion templates/Pagination/uikit_v3_pagination.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
</li>
{% else %}
<li>
<a href="{{ path(route, query|merge({(pageParameterName): (pageCount - 1)})) }}">{{ pageCount -1 }}</a>
<a href="{{ path(route, query|merge({(pageParameterName): (pageCount - 1)})) }}">{{ pageCount - 1 }}</a>
</li>
{% endif %}
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion templates/Pagination/uikit_v3_sortable.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @author KULDIP PIPALIYA <[email protected]>
*/
#}
<a{% for attr, value in options %} {{ attr }}="{{ value }}"{% endfor %} style="color: #000;">
<a{% for attr, value in options %} {{ attr }}="{{ value }}"{% endfor %} style="color: #000;">
<span class="pull-right">
{% if sorted %}
{% if direction == 'desc' %}
Expand Down

0 comments on commit cf9d768

Please sign in to comment.