10000 Merge branch '6.3' into 6.4 · symfony/symfony@5a1f402 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5a1f402

Browse files
Merge branch '6.3' into 6.4
* 6.3: add support for nikic/php-parser 5.0
2 parents 22074ef + 512f8c4 commit 5a1f402

File tree

6 files changed

+13
-4
lines changed

6 files changed

+13
-4
lines changed

.github/workflows/unit-tests.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,10 @@ jobs:
128128
echo SYMFONY_REQUIRE=">=$([ '${{ matrix.mode }}' = low-deps ] && echo 5.4 || echo $SYMFONY_VERSION)" >> $GITHUB_ENV
129129
[[ "${{ matrix.mode }}" = *-deps ]] && mv composer.json.phpunit composer.json || true
130130
131+
if [[ "${{ matrix.mode }}" = low-deps ]]; then
132+
echo SYMFONY_PHPUNIT_REQUIRE="nikic/php-parser:^4.16" >> $GITHUB_ENV
133+
fi
134+
131135
- name: Install dependencies
132136
run: |
133137
echo "::group::composer update"

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@
142142
"league/uri": "^6.5|^7.0",
143143
"masterminds/html5": "^2.7.2",
144144
"monolog/monolog": "^1.25.1|^2",
145+
"nikic/php-parser": "^4.16|^5.0",
145146
"nyholm/psr7": "^1.0",
146147
"pda/pheanstalk": "^4.0",
147148
"php-http/discovery": "^1.15",

src/Symfony/Component/Translation/Extractor/PhpAstExtractor.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,11 @@ public function __construct(
3939
throw new \LogicException(sprintf('You cannot use "%s" as the "nikic/php-parser" package is not installed. Try running "composer require nikic/php-parser".', static::class));
4040
}
4141

42-
$this->parser = (new ParserFactory())->create(ParserFactory::PREFER_PHP7);
42+
if (method_exists(ParserFactory::class, 'createForHostVersion')) {
43+
$this->parser = (new ParserFactory())->createForHostVersion();
44+
} else {
45+
$this->parser = (new ParserFactory())->create(ParserFactory::PREFER_PHP7);
46+
}
4347
}
4448

4549
public function extract(iterable|string $resource, MessageCatalogue $catalogue): void

src/Symfony/Component/Translation/Extractor/Visitor/ConstraintVisitor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function enterNode(Node $node): ?Node
4242
return null;
4343
}
4444

45-
$parts = $className->parts;
45+
$parts = $className->getParts();
4646
$isConstraintClass = false;
4747

4848
foreach ($parts as $part) {

src/Symfony/Component/Translation/Extractor/Visitor/TranslatableMessageVisitor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function enterNode(Node $node): ?Node
3434
return null;
3535
}
3636

37-
if (!\in_array('TranslatableMessage', $className->parts, true)) {
37+
if (!\in_array('TranslatableMessage', $className->getParts(), true)) {
3838
return null;
3939
}
4040

src/Symfony/Component/Translation/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"symfony/translation-contracts": "^2.5|^3.0"
2323
},
2424
"require-dev": {
25-
"nikic/php-parser": "^4.13",
25+
"nikic/php-parser": "^4.16|^5.0",
2626
"symfony/config": "^5.4|^6.0|^7.0",
2727
"symfony/console": "^5.4|^6.0|^7.0",
2828
"symfony/dependency-injection": "^5.4|^6.0|^7.0",

0 commit comments

Comments
 (0)
0