Skip to content

Commit 09d4348

Browse files
Merge branch '6.4' into 7.2
* 6.4: [GHA] Enable igbinary on windows [Validator] Add missing Polish plural form for filename length validator [ExpressionLanguage] Fix dumping of null safe operator
2 parents e88263c + 25bbdca commit 09d4348

File tree

6 files changed

+21
-15
lines changed

6 files changed

+21
-15
lines changed

.github/workflows/windows.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,15 @@ jobs:
4343
run: |
4444
$env:Path = 'c:\php;' + $env:Path
4545
mkdir c:\php && cd c:\php
46-
iwr -outf php-8.2.0-Win32-vs16-x86.zip https://github.com/symfony/binary-utils/releases/download/v0.1/php-8.2.0-Win32-vs16-x86.zip
47-
7z x php-8.2.0-Win32-vs16-x86.zip -y >nul
46+
iwr -outf php.zip https://github.com/symfony/binary-utils/releases/download/v0.1/php-8.2.0-Win32-vs16-x86.zip
47+
7z x php.zip -y >nul
4848
cd ext
49-
iwr -outf php_apcu-5.1.22-8.2-ts-vs16-x86.zip https://github.com/symfony/binary-utils/releases/download/v0.1/php_apcu-5.1.22-8.2-ts-vs16-x86.zip
50-
7z x php_apcu-5.1.22-8.2-ts-vs16-x86.zip -y >nul
51-
iwr -outf php_redis-6.0.0-dev-8.2-ts-vs16-x86.zip https://github.com/symfony/binary-utils/releases/download/v0.1/php_redis-6.0.0-dev-8.2-ts-vs16-x86.zip
52-
7z x php_redis-6.0.0-dev-8.2-ts-vs16-x86.zip -y >nul
49+
iwr -outf php_apcu.zip https://github.com/symfony/binary-utils/releases/download/v0.1/php_apcu-5.1.22-8.2-ts-vs16-x86.zip
50+
7z x php_apcu.zip -y >nul
51+
iwr -outf php_igbinary.zip https://github.com/symfony/binary-utils/releases/download/v0.1/php_igbinary-3.2.16-8.2-ts-vs16-x86.zip
52+
7z x php_igbinary.zip -y >nul
53+
iwr -outf php_redis.zip https://github.com/symfony/binary-utils/releases/download/v0.1/php_redis-6.0.0-dev-8.2-ts-vs16-x86.zip
54+
7z x php_redis.zip -y >nul
5355
cd ..
5456
Copy php.ini-development php.ini-min
5557
"memory_limit=-1" >> php.ini-min

src/Symfony/Component/ExpressionLanguage/Node/GetAttrNode.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,12 +141,13 @@ private function isShortCircuited(): bool
141141

142142
public function toArray(): array
143143
{
144+
$nullSafe = $this->nodes['attribute'] instanceof ConstantNode && $this->nodes['attribute']->isNullSafe;
144145
switch ($this->attributes['type']) {
145146
case self::PROPERTY_CALL:
146-
return [$this->nodes['node'], '.', $this->nodes['attribute']];
147+
return [$this->nodes['node'], $nullSafe ? '?.' : '.', $this->nodes['attribute']];
147148

148149
case self::METHOD_CALL:
149-
return [$this->nodes['node'], '.', $this->nodes['attribute'], '(', $this->nodes['arguments'], ')'];
150+
return [$this->nodes['node'], $nullSafe ? '?.' : '.', $this->nodes['attribute'], '(', $this->nodes['arguments'], ')'];
150151

151152
case self::ARRAY_CALL:
152153
return [$this->nodes['node'], '[', $this->nodes['attribute'], ']'];

src/Symfony/Component/ExpressionLanguage/Tests/ExpressionLanguageTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -412,9 +412,9 @@ public function testNullSafeCompileFails($expression, $foo)
412412

413413
public static function provideInvalidNullSafe()
414414
{
415-
yield ['foo?.bar.baz', (object) ['bar' => null], 'Unable to get property "baz" of non-object "foo.bar".'];
416-
yield ['foo?.bar["baz"]', (object) ['bar' => null], 'Unable to get an item of non-array "foo.bar".'];
417-
yield ['foo?.bar["baz"].qux.quux', (object) ['bar' => ['baz' => null]], 'Unable to get property "qux" of non-object "foo.bar["baz"]".'];
415+
yield ['foo?.bar.baz', (object) ['bar' => null], 'Unable to get property "baz" of non-object "foo?.bar".'];
416+
yield ['foo?.bar["baz"]', (object) ['bar' => null], 'Unable to get an item of non-array "foo?.bar".'];
417+
yield ['foo?.bar["baz"].qux.quux', (object) ['bar' => ['baz' => null]], 'Unable to get property "qux" of non-object "foo?.bar["baz"]".'];
418418
}
419419

420420
/**

src/Symfony/Component/ExpressionLanguage/Tests/Node/FunctionNodeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public static function getCompileData(): array
3434
public static function getDumpData(): array
3535
{
3636
return [
37-
['foo("bar")', new FunctionNode('foo', new Node([new ConstantNode('bar')])), ['foo' => static::getCallables()]],
37+
['foo("bar")', new FunctionNode('foo', new Node([new ConstantNode('bar')]))],
3838
];
3939
}
4040

src/Symfony/Component/ExpressionLanguage/Tests/Node/GetAttrNodeTest.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
use Symfony\Component\ExpressionLanguage\Node\ConstantNode;
1616
use Symfony\Component\ExpressionLanguage\Node\GetAttrNode;
1717
use Symfony\Component\ExpressionLanguage\Node\NameNode;
18+
use Symfony\Component\ExpressionLanguage\Node\ArgumentsNode;
1819

1920
class GetAttrNodeTest extends AbstractNodeTestCase
2021
{
@@ -50,10 +51,12 @@ public static function getDumpData(): array
5051
['foo[0]', new GetAttrNode(new NameNode('foo'), new ConstantNode(0), self::getArrayNode(), GetAttrNode::ARRAY_CALL)],
5152
['foo["b"]', new GetAttrNode(new NameNode('foo'), new ConstantNode('b'), self::getArrayNode(), GetAttrNode::ARRAY_CALL)],
5253

53-
['foo.foo', new GetAttrNode(new NameNode('foo'), new NameNode('foo'), self::getArrayNode(), GetAttrNode::PROPERTY_CALL), ['foo' => new Obj()]],
54+
['foo.foo', new GetAttrNode(new NameNode('foo'), new NameNode('foo'), self::getArrayNode(), GetAttrNode::PROPERTY_CALL)],
5455

55-
['foo.foo({"b": "a", 0: "b"})', new GetAttrNode(new NameNode('foo'), new NameNode('foo'), self::getArrayNode(), GetAttrNode::METHOD_CALL), ['foo' => new Obj()]],
56+
['foo.foo({"b": "a", 0: "b"})', new GetAttrNode(new NameNode('foo'), new NameNode('foo'), self::getArrayNode(), GetAttrNode::METHOD_CALL)],
5657
['foo[index]', new GetAttrNode(new NameNode('foo'), new NameNode('index'), self::getArrayNode(), GetAttrNode::ARRAY_CALL)],
58+
59+
['foo?.foo()', new GetAttrNode(new NameNode('foo'), new ConstantNode('foo', true, true), new ArgumentsNode(), GetAttrNode::METHOD_CALL)],
5760
];
5861
}
5962

src/Symfony/Component/Validator/Resources/translations/validators.pl.xlf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@
404404
</trans-unit>
405405
<trans-unit id="104">
406406
<source>The filename is too long. It should have {{ filename_max_length }} character or less.|The filename is too long. It should have {{ filename_max_length }} characters or less.</source>
407-
<target>Nazwa pliku jest za długa. Powinna mieć {{ filename_max_length }} znak lub mniej.|Nazwa pliku jest za długa. Powinna mieć {{ filename_max_length }} znaków lub mniej.</target>
407+
<target>Nazwa pliku jest za długa. Powinna mieć {{ filename_max_length }} znak lub mniej.|Nazwa pliku jest za długa. Powinna mieć {{ filename_max_length }} znaki lub mniej.|Nazwa pliku jest za długa. Powinna mieć {{ filename_max_length }} znaków lub mniej.</target>
408408
</trans-unit>
409409
<trans-unit id="105">
410410
<source>The password strength is too low. Please use a stronger password.</source>

0 commit comments

Comments
 (0)