- Issue created by @linwilvic
- Status changed to Needs review
6 months ago 8:34am 12 August 2024
The Extra Field module encounters a syntax error in the `di.twig` file when running the `test:code` task using Lullabot Drainpipe. This issue disrupts the development workflow and prevents successful linting of the code.
[test:lint] ERROR in web/modules/contrib/extra_field/src/Generators/lib/di.twig (line 5) [test:lint] 3 {% endmacro %} [test:lint] 4 {% macro use(services) %} [test:lint] >> 5 {% sort %} [test:lint] >> Unexpected "sort" tag (expecting closing tag for the "macro" tag defined near line 5). [test:lint] 6 {% for service in services %} [test:lint] 7 use {{ service.type }};
Correct the Twig template in `di.twig` to remove the invalid `{% sort %}` tag and ensure all macro blocks are properly closed. The corrected version of the file should look like this:
{% macro arguments(services) %} {% for service_id, service in services %}'@{{ service_id }}'{{ loop.last ? '' : ', ' }}{% endfor %} {% endmacro %} {% macro use(services) %} {% for service in services %} use {{ service.type }}; {% endfor %} {% endmacro %} {% macro properties(services) %} {% for service in services %} /** * {{ service.description }} * * @var \{{ service.type }} */ protected ${{ service.name|camelize(false) }};{{ loop.last ? '' : "\n\n" }} {%- endfor %} {% endmacro %} {% macro annotation(services) %} {% for service in services %} * @param \{{ service.type }} ${{ service.name }} * {{ service.description }}{{ loop.last ? '' : "\n" }} {%- endfor %} {% endmacro %} {% macro signature(services) %} {% for service in services %}{{ service.short_type }} ${{ service.name }}{{ loop.last ? '' : ', ' }}{% endfor %} {% endmacro %} {% macro assignment(services) %} {% for service in services %} $this->{{ service.name|camelize(false) }} = ${{ service.name }};{{ loop.last ? '' : "\n" }} {%- endfor %} {% endmacro %} {% macro container(services) %} {% for service_id, service in services %} $container->get('{{ service_id }}'){{ loop.last ? '' : ",\n" }} {%- endfor %} {% endmacro %}
Needs review
2.3
Code