Skip to content

Commit 52c05a5

Browse files
Merge branch '5.3' into 5.4
* 5.3: [Runtime] Consider also $_ENV when resolving APP_RUNTIME and APP_RUNTIME_OPTIONS [Config] Fix signature generation with nested attributes on PHP 8.1 [Cache] allow/provide psr/simple-cache v2 [Validator] Add missing translations for Slovenian (sl) Add missing translations for Bosnian (bs) Bump Symfony version to 4.4.34 Update VERSION for 4.4.33 Update CONTRIBUTORS for 4.4.33 Update CHANGELOG for 4.4.33
2 parents 46cda1e + 4237bc5 commit 52c05a5

File tree

8 files changed

+146
-48
lines changed

8 files changed

+146
-48
lines changed

CONTRIBUTORS.md

+93-37
Large diffs are not rendered by default.

composer.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"psr/http-client-implementation": "1.0",
2525
"psr/link-implementation": "1.0",
2626
"psr/log-implementation": "1.0|2.0",
27-
"psr/simple-cache-implementation": "1.0",
27+
"psr/simple-cache-implementation": "1.0|2.0",
2828
"symfony/cache-implementation": "1.0|2.0",
2929
"symfony/event-dispatcher-implementation": "2.0",
3030
"symfony/http-client-implementation": "2.4",
@@ -140,7 +140,7 @@
140140
"php-http/httplug": "^1.0|^2.0",
141141
"predis/predis": "~1.1",
142142
"psr/http-client": "^1.0",
143-
"psr/simple-cache": "^1.0",
143+
"psr/simple-cache": "^1.0|^2.0",
144144
"egulias/email-validator": "^2.1.10|^3.1",
145145
"symfony/mercure-bundle": "^0.3",
146146
"symfony/phpunit-bridge": "^5.2|^6.0",

src/Symfony/Component/Cache/composer.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
],
1818
"provide": {
1919
"psr/cache-implementation": "1.0|2.0",
20-
"psr/simple-cache-implementation": "1.0",
20+
"psr/simple-cache-implementation": "1.0|2.0",
2121
"symfony/cache-implementation": "1.0|2.0"
2222
},
2323
"require": {
@@ -36,7 +36,7 @@
3636
"doctrine/cache": "^1.6|^2.0",
3737
"doctrine/dbal": "^2.13.1|^3.0",
3838
"predis/predis": "^1.1",
39-
"psr/simple-cache": "^1.0",
39+
"psr/simple-cache": "^1.0|^2.0",
4040
"symfony/config": "^4.4|^5.0|^6.0",
4141
"symfony/dependency-injection": "^4.4|^5.0|^6.0",
4242
"symfony/filesystem": "^4.4|^5.0|^6.0",

src/Symfony/Component/Config/Resource/ReflectionClassResource.php

+10-4
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ private function generateSignature(\ReflectionClass $class): iterable
124124
if (\PHP_VERSION_ID >= 80000) {
125125
$attributes = [];
126126
foreach ($class->getAttributes() as $a) {
127-
$attributes[] = [$a->getName(), $a->getArguments()];
127+
$attributes[] = [$a->getName(), \PHP_VERSION_ID >= 80100 ? (string) $a : $a->getArguments()];
128128
}
129129
yield print_r($attributes, true);
130130
$attributes = [];
@@ -148,7 +148,7 @@ private function generateSignature(\ReflectionClass $class): iterable
148148
foreach ($class->getProperties(\ReflectionProperty::IS_PUBLIC | \ReflectionProperty::IS_PROTECTED) as $p) {
149149
if (\PHP_VERSION_ID >= 80000) {
150150
foreach ($p->getAttributes() as $a) {
151-
$attributes[] = [$a->getName(), $a->getArguments()];
151+
$attributes[] = [$a->getName(), \PHP_VERSION_ID >= 80100 ? (string) $a : $a->getArguments()];
152152
}
153153
yield print_r($attributes, true);
154154
$attributes = [];
@@ -168,7 +168,7 @@ private function generateSignature(\ReflectionClass $class): iterable
168168
foreach ($class->getMethods(\ReflectionMethod::IS_PUBLIC | \ReflectionMethod::IS_PROTECTED) as $m) {
169169
if (\PHP_VERSION_ID >= 80000) {
170170
foreach ($m->getAttributes() as $a) {
171-
$attributes[] = [$a->getName(), $a->getArguments()];
171+
$attributes[] = [$a->getName(), \PHP_VERSION_ID >= 80100 ? (string) $a : $a->getArguments()];
172172
}
173173
yield print_r($attributes, true);
174174
$attributes = [];
@@ -179,7 +179,7 @@ private function generateSignature(\ReflectionClass $class): iterable
179179
foreach ($m->getParameters() as $p) {
180180
if (\PHP_VERSION_ID >= 80000) {
181181
foreach ($p->getAttributes() as $a) {
182-
$attributes[] = [$a->getName(), $a->getArguments()];
182+
$attributes[] = [$a->getName(), \PHP_VERSION_ID >= 80100 ? (string) $a : $a->getArguments()];
183183
}
184184
yield print_r($attributes, true);
185185
$attributes = [];
@@ -191,6 +191,12 @@ private function generateSignature(\ReflectionClass $class): iterable
191191
continue;
192192
}
193193

194+
if (\PHP_VERSION_ID >= 80100) {
195+
$defaults[$p->name] = (string) $p;
196+
197+
continue;
198+
}
199+
194200
if (!$p->isDefaultValueConstant() || $defined($p->getDefaultValueConstantName())) {
195201
$defaults[$p->name] = $p->getDefaultValue();
196202

src/Symfony/Component/Config/Tests/Resource/ReflectionClassResourceTest.php

+21-1
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,10 @@ public function provideHashedSignature(): iterable
126126
yield [true, 0, '#[Foo]'];
127127
}
128128

129+
if (\PHP_VERSION_ID >= 80100) {
130+
yield [true, 0, '#[Foo(new MissingClass)]'];
131+
}
132+
129133
yield [true, 1, 'abstract class %s'];
130134
yield [true, 1, 'final class %s'];
131135
yield [true, 1, 'class %s extends Exception'];
@@ -135,6 +139,11 @@ public function provideHashedSignature(): iterable
135139
yield [true, 4, '/** pub docblock */'];
136140
yield [true, 5, 'protected $pub = [];'];
137141
yield [true, 5, 'public $pub = [123];'];
142+
143+
if (\PHP_VERSION_ID >= 80100) {
144+
yield [true, 5, '#[Foo(new MissingClass)] public $pub = [];'];
145+
}
146+
138147
yield [true, 6, '/** prot docblock */'];
139148
yield [true, 7, 'private $prot;'];
140149
yield [false, 8, '/** priv docblock */'];
@@ -151,6 +160,11 @@ public function provideHashedSignature(): iterable
151160
yield [true, 13, 'protected function prot(#[Foo] $a = []) {}'];
152161
}
153162

163+
if (\PHP_VERSION_ID >= 80100) {
164+
yield [true, 13, '#[Foo(new MissingClass)] protected function prot($a = []) {}'];
165+
yield [true, 13, 'protected function prot(#[Foo(new MissingClass)] $a = []) {}'];
166+
}
167+
154168
yield [false, 14, '/** priv docblock */'];
155169
yield [false, 15, ''];
156170

@@ -162,10 +176,16 @@ public function provideHashedSignature(): iterable
162176
yield [false, 9, 'private string $priv;'];
163177
}
164178

179+
if (\PHP_VERSION_ID >= 80100) {
180+
yield [true, 17, 'public function __construct(private $bar = new \stdClass()) {}'];
181+
yield [true, 17, 'public function ccc($bar = new \stdClass()) {}'];
182+
yield [true, 17, 'public function ccc($bar = new MissingClass()) {}'];
183+
}
184+
165185
yield [true, 17, 'public function ccc($bar = 187) {}'];
166186
yield [true, 17, 'public function ccc($bar = ANOTHER_ONE_THAT_WILL_NEVER_BE_DEFINED_CCCCCCCCC) {}'];
167187
yield [true, 17, 'public function ccc($bar = parent::BOOM) {}'];
168-
yield [true, 17, null, static function () { \define('A_CONSTANT_THAT_FOR_SURE_WILL_NEVER_BE_DEFINED_CCCCCC', 'foo'); }];
188+
yield [\PHP_VERSION_ID < 80100, 17, null, static function () { \define('A_CONSTANT_THAT_FOR_SURE_WILL_NEVER_BE_DEFINED_CCCCCC', 'foo'); }];
169189
}
170190

171191
public function testEventSubscriber()

src/Symfony/Component/Runtime/Internal/autoload_runtime.template

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ if (!is_object($app)) {
1818
throw new TypeError(sprintf('Invalid return value: callable object expected, "%s" returned from "%s".', get_debug_type($app), $_SERVER['SCRIPT_FILENAME']));
1919
}
2020

21-
$runtime = $_SERVER['APP_RUNTIME'] ?? %runtime_class%;
22-
$runtime = new $runtime(($_SERVER['APP_RUNTIME_OPTIONS'] ?? []) + %runtime_options%);
21+
$runtime = $_SERVER['APP_RUNTIME'] ?? $_ENV['APP_RUNTIME'] ?? %runtime_class%;
22+
$runtime = new $runtime(($_SERVER['APP_RUNTIME_OPTIONS'] ?? $_ENV['APP_RUNTIME_OPTIONS'] ?? []) + %runtime_options%);
2323

2424
[$app, $args] = $runtime
2525
->getResolver($app)

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

+8
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,14 @@
394394
<source>This value is not a valid CSS color.</source>
395395
<target>Ova vrijednost nije važeća CSS boja.</target>
396396
</trans-unit>
397+
<trans-unit id="102">
398+
<source>This value is not a valid CIDR notation.</source>
399+
<target>Ova vrijednost nije važeća CIDR notacija.</target>
400+
</trans-unit>
401+
<trans-unit id="103">
402+
<source>The value of the netmask should be between {{ min }} and {{ max }}.</source>
403+
<target>Vrijednost NetMask bi trebala biti između {{min}} i {{max}}.</target>
404+
</trans-unit>
397405
</body>
398406
</file>
399407
</xliff>

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

+8
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,14 @@
394394
<source>This value is not a valid CSS color.</source>
395395
<target>Ta vrednost ni veljavna barva CSS.</target>
396396
</trans-unit>
397+
<trans-unit id="102">
398+
<source>This value is not a valid CIDR notation.</source>
399+
<target>Ta vrednost ni veljaven zapis CIDR.</target>
400+
</trans-unit>
401+
<trans-unit id="103">
402+
<source>The value of the netmask should be between {{ min }} and {{ max }}.</source>
403+
<target>Vrednost omrežne maske mora biti med {{ min }} in {{ max }}.</target>
404+
</trans-unit>
397405
</body>
398406
</file>
399407
</xliff>

0 commit comments

Comments
 (0)