From 5aa1771279eeea534ceb238850ba3d03ffcb412b Mon Sep 17 00:00:00 2001 From: qkdreyer Date: Mon, 26 Feb 2024 15:29:03 +0100 Subject: [PATCH] chore: fix phpcs + nikic/php-parser@4 compatibility --- Tests/Translation/Extractor/File/Fixture/MyFormType.php | 2 +- Translation/Extractor/File/FormExtractor.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/Translation/Extractor/File/Fixture/MyFormType.php b/Tests/Translation/Extractor/File/Fixture/MyFormType.php index 67d40c3c..c487abdc 100644 --- a/Tests/Translation/Extractor/File/Fixture/MyFormType.php +++ b/Tests/Translation/Extractor/File/Fixture/MyFormType.php @@ -68,5 +68,5 @@ public function buildForm(FormBuilderInterface $builder, array $options) ]); } - const CHOICES = ['choices' => [null]]; + public const CHOICES = ['choices' => [null]]; } diff --git a/Translation/Extractor/File/FormExtractor.php b/Translation/Extractor/File/FormExtractor.php index e6caa1ec..6f6b7ef1 100644 --- a/Translation/Extractor/File/FormExtractor.php +++ b/Translation/Extractor/File/FormExtractor.php @@ -244,7 +244,7 @@ protected function parseChoiceNode(Node $item, Node $node, $domain) foreach ($item->value->items as $index => $subItem) { $newItem = clone $subItem; $newItem->key = $subItem->value; - $newItem->value = $subItem->key ?? new Node\Scalar\Int_($index); + $newItem->value = $subItem->key ?? new Node\Scalar\LNumber($index); $subItem = $newItem; $this->parseItem($subItem, $domain); }