diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7681279be..b18211293 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -52,6 +52,9 @@ jobs: continue-on-error: true + env: + SYMFONY_PHPUNIT_VERSION: ${{ matrix.php-version == '8.1' && '9.6' || '11.3' }} + strategy: matrix: php-version: @@ -83,7 +86,7 @@ jobs: - name: "Add PHPUnit matcher" run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" - - name: "Prevent installing symfony/translation-contract 3.0" + - name: "Prevent installing symfony/translation-contracts 3.0" if: "matrix.extension == 'twig-extra-bundle'" working-directory: extra/${{ matrix.extension }} run: "composer require --no-update 'symfony/translation-contracts:^1.1|^2.0'" @@ -95,6 +98,10 @@ jobs: - name: "Run tests for ${{ matrix.extension }}" working-directory: extra/${{ matrix.extension }} env: + # intl-extra's integration tests expect en_US-formatted ICU output. The Ubuntu + # runner default (C.UTF-8) makes ICU fall back to the "C" locale, producing e.g. + # "€ 1000000.00" instead of "€1,000,000.00". phpunit.xml.dist's entry is + # too late because ICU caches the default locale at the first call. LANG: 'en_US.UTF-8' run: phpunit diff --git a/src/Node/CheckSecurityNode.php b/src/Node/CheckSecurityNode.php index 2b131ce6b..9860de57e 100644 --- a/src/Node/CheckSecurityNode.php +++ b/src/Node/CheckSecurityNode.php @@ -52,9 +52,9 @@ class CheckSecurityNode extends Node ->indent() ->write("\$this->sandbox->checkSecurity(\n") ->indent() - ->write(!$this->usedTags ? "[],\n" : "['".implode("', '", array_keys($this->usedTags))."'],\n") - ->write(!$this->usedFilters ? "[],\n" : "['".implode("', '", array_keys($this->usedFilters))."'],\n") - ->write(!$this->usedFunctions ? "[],\n" : "['".implode("', '", array_keys($this->usedFunctions))."'],\n") + ->write('')->repr(array_keys($this->usedTags))->raw(",\n") + ->write('')->repr(array_keys($this->usedFilters))->raw(",\n") + ->write('')->repr(array_keys($this->usedFunctions))->raw(",\n") ->write("\$this->source\n") ->outdent() ->write(");\n")