Skip to content

Commit aa232c4

Browse files
minor symfony#53475 [Translation] simplify the parser factory creation (xabbuh)
This PR was merged into the 6.3 branch. Discussion ---------- [Translation] simplify the parser factory creation | Q | A | ------------- | --- | Branch? | 6.3 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | continuation of symfony#53453 | License | MIT Commits ------- 509ca9b simplify the parser factory creation
2 parents 6bdf7f9 + 509ca9b commit aa232c4

File tree

4 files changed

+4
-8
lines changed

4 files changed

+4
-8
lines changed

.github/workflows/unit-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ jobs:
129129
[[ "${{ matrix.mode }}" = *-deps ]] && mv composer.json.phpunit composer.json || true
130130
131131
if [[ "${{ matrix.mode }}" = low-deps ]]; then
132-
echo SYMFONY_PHPUNIT_REQUIRE="nikic/php-parser:^4.16" >> $GITHUB_ENV
132+
echo SYMFONY_PHPUNIT_REQUIRE="nikic/php-parser:^4.18" >> $GITHUB_ENV
133133
fi
134134
135135
- name: Install dependencies

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@
140140
"league/uri": "^6.5|^7.0",
141141
"masterminds/html5": "^2.7.2",
142142
"monolog/monolog": "^1.25.1|^2",
143-
"nikic/php-parser": "^4.16|^5.0",
143+
"nikic/php-parser": "^4.18|^5.0",
144144
"nyholm/psr7": "^1.0",
145145
"pda/pheanstalk": "^4.0",
146146
"php-http/discovery": "^1.15",

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,7 @@ 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-
if (method_exists(ParserFactory::class, 'createForHostVersion')) {
43-
$this->parser = (new ParserFactory())->createForHostVersion();
44-
} else {
45-
$this->parser = (new ParserFactory())->create(ParserFactory::PREFER_PHP7);
46-
}
42+
$this->parser = (new ParserFactory())->createForHostVersion();
4743
}
4844

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

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.16|^5.0",
25+
"nikic/php-parser": "^4.18|^5.0",
2626
"symfony/config": "^5.4|^6.0",
2727
"symfony/console": "^5.4|^6.0",
2828
"symfony/dependency-injection": "^5.4|^6.0",

0 commit comments

Comments
 (0)