Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit cbbecbb

Browse filesBrowse files
committed
Merge branch '7.0' into 7.1
* 7.0: Update PR template Review Indonesian (id) translation [Security] reviewed Latvian translation of key 20 [VarExporter] Fix exporting default values involving global constants review: RU translation [Security] reviewed Polish translation of key 20 Reviewing translations for Japanese. [Serializer] Cache readability/writability computation Update security.fr.xlf
2 parents 8f7f216 + 69b39c4 commit cbbecbb
Copy full SHA for cbbecbb

File tree

11 files changed

+60
-35
lines changed
Filter options

11 files changed

+60
-35
lines changed

‎.github/PULL_REQUEST_TEMPLATE.md

Copy file name to clipboardExpand all lines: .github/PULL_REQUEST_TEMPLATE.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
| Q | A
22
| ------------- | ---
3-
| Branch? | 7.1 for features / 5.4, 6.4, or 7.0 for bug fixes <!-- see below -->
3+
| Branch? | 7.2 for features / 5.4, 6.4, 7.0, and 7.1 for bug fixes <!-- see below -->
44
| Bug fix? | yes/no
55
| New feature? | yes/no <!-- please update src/**/CHANGELOG.md files -->
66
| Deprecations? | yes/no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->

‎src/Symfony/Component/Security/Core/Resources/translations/security.fr.xlf

Copy file name to clipboardExpand all lines: src/Symfony/Component/Security/Core/Resources/translations/security.fr.xlf
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
</trans-unit>
7777
<trans-unit id="20">
7878
<source>Too many failed login attempts, please try again in %minutes% minutes.</source>
79-
<target state="needs-review-translation">Trop de tentatives de connexion échouées, veuillez réessayer dans %minutes% minutes.</target>
79+
<target>Trop de tentatives de connexion échouées, veuillez réessayer dans %minutes% minutes.</target>
8080
</trans-unit>
8181
</body>
8282
</file>

‎src/Symfony/Component/Security/Core/Resources/translations/security.id.xlf

Copy file name to clipboardExpand all lines: src/Symfony/Component/Security/Core/Resources/translations/security.id.xlf
+7-7Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<body>
55
<trans-unit id="1">
66
<source>An authentication exception occurred.</source>
7-
<target>Terjadi sebuah pengecualian otentikasi.</target>
7+
<target>Terjadi kesalahan otentikasi.</target>
88
</trans-unit>
99
<trans-unit id="2">
1010
<source>Authentication credentials could not be found.</source>
@@ -16,7 +16,7 @@
1616
</trans-unit>
1717
<trans-unit id="4">
1818
<source>Invalid credentials.</source>
19-
<target>Kredensial salah.</target>
19+
<target>Kredensial tidak valid.</target>
2020
</trans-unit>
2121
<trans-unit id="5">
2222
<source>Cookie has already been used by someone else.</source>
@@ -28,7 +28,7 @@
2828
</trans-unit>
2929
<trans-unit id="7">
3030
<source>Invalid CSRF token.</source>
31-
<target>Token CSRF salah.</target>
31+
<target>Token CSRF tidak valid.</target>
3232
</trans-unit>
3333
<trans-unit id="9">
3434
<source>No authentication provider found to support the authentication token.</source>
@@ -64,19 +64,19 @@
6464
</trans-unit>
6565
<trans-unit id="17">
6666
<source>Too many failed login attempts, please try again later.</source>
67-
<target>Terlalu banyak percobaan login yang salah, silahkan coba lagi nanti.</target>
67+
<target>Terlalu banyak percobaan login yang gagal, silahkan coba lagi nanti.</target>
6868
</trans-unit>
6969
<trans-unit id="18">
7070
<source>Invalid or expired login link.</source>
71-
<target>Link login salah atau sudah kedaluwarsa.</target>
71+
<target>Link login tidak valid atau sudah kedaluwarsa.</target>
7272
</trans-unit>
7373
<trans-unit id="19">
7474
<source>Too many failed login attempts, please try again in %minutes% minute.</source>
75-
<target>Terlalu banyak percobaan login yang salah, silahkan coba lagi dalam %minutes% menit.</target>
75+
<target>Terlalu banyak percobaan login yang gagal, silahkan coba lagi dalam %minutes% menit.</target>
7676
</trans-unit>
7777
<trans-unit id="20">
7878
<source>Too many failed login attempts, please try again in %minutes% minutes.</source>
79-
<target state="needs-review-translation">Terlalu banyak upaya login yang gagal, silakan coba lagi dalam %minutes% menit.|Terlalu banyak upaya login yang gagal, silakan coba lagi dalam %minutes% menit.</target>
79+
<target>Terlalu banyak upaya login yang gagal, silakan coba lagi dalam beberapa %minutes% menit.</target>
8080
</trans-unit>
8181
</body>
8282
</file>

‎src/Symfony/Component/Security/Core/Resources/translations/security.ja.xlf

Copy file name to clipboardExpand all lines: src/Symfony/Component/Security/Core/Resources/translations/security.ja.xlf
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
</trans-unit>
7777
<trans-unit id="20">
7878
<source>Too many failed login attempts, please try again in %minutes% minutes.</source>
79-
<target state="needs-review-translation">ログイン試行の失敗が多すぎます。%minutes% 分後に再試行してください。|ログイン試行の失敗が多すぎます。%minutes% 分後に再試行してください。</target>
79+
<target>ログイン試行回数が多すぎます。%minutes%分後に再度お試しください。</target>
8080
</trans-unit>
8181
</body>
8282
</file>

‎src/Symfony/Component/Security/Core/Resources/translations/security.lv.xlf

Copy file name to clipboardExpand all lines: src/Symfony/Component/Security/Core/Resources/translations/security.lv.xlf
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
</trans-unit>
7777
<trans-unit id="20">
7878
<source>Too many failed login attempts, please try again in %minutes% minutes.</source>
79-
<target state="needs-review-translation">Pārāk daudz neveiksmīgu pieteikšanās mēģinājumu, lūdzu, mēģiniet vēlreiz pēc %minutes% minūtes.|Pārāk daudz neveiksmīgu pieteikšanās mēģinājumu, lūdzu, mēģiniet vēlreiz pēc %minutes% minūtēm.</target>
79+
<target>Pārāk daudz neveiksmīgu autentifikācijas mēģinājumu, lūdzu, mēģiniet vēlreiz pēc %minutes% minūtes.|Pārāk daudz neveiksmīgu autentifikācijas mēģinājumu, lūdzu, mēģiniet vēlreiz pēc %minutes% minūtēm.</target>
8080
</trans-unit>
8181
</body>
8282
</file>

‎src/Symfony/Component/Security/Core/Resources/translations/security.pl.xlf

Copy file name to clipboardExpand all lines: src/Symfony/Component/Security/Core/Resources/translations/security.pl.xlf
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
</trans-unit>
7777
<trans-unit id="20">
7878
<source>Too many failed login attempts, please try again in %minutes% minutes.</source>
79-
<target state="needs-review-translation">Zbyt wiele nieudanych prób logowania, spróbuj ponownie za %minutes% minutę.|Zbyt wiele nieudanych prób logowania, spróbuj ponownie za %minutes% minuty.|Zbyt wiele nieudanych prób logowania, spróbuj ponownie za %minutes% minut.</target>
79+
<target>Zbyt wiele nieudanych prób logowania, spróbuj ponownie za %minutes% minutę.|Zbyt wiele nieudanych prób logowania, spróbuj ponownie za %minutes% minuty.|Zbyt wiele nieudanych prób logowania, spróbuj ponownie za %minutes% minut.</target>
8080
</trans-unit>
8181
</body>
8282
</file>

‎src/Symfony/Component/Security/Core/Resources/translations/security.ru.xlf

Copy file name to clipboardExpand all lines: src/Symfony/Component/Security/Core/Resources/translations/security.ru.xlf
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,11 @@
7272
</trans-unit>
7373
<trans-unit id="19">
7474
<source>Too many failed login attempts, please try again in %minutes% minute.</source>
75-
<target>Слишком много неудачных попыток входа в систему, повторите попытку через %minutes% минуту.</target>
75+
<target>Слишком много неудачных попыток входа, повторите попытку через %minutes% минуту.</target>
7676
</trans-unit>
7777
<trans-unit id="20">
7878
<source>Too many failed login attempts, please try again in %minutes% minutes.</source>
79-
<target state="needs-review-translation">Слишком много неудачных попыток входа в систему, попробуйте снова через %minutes% минуту.|Слишком много неудачных попыток входа в систему, попробуйте снова через %minutes% минуты.|Слишком много неудачных попыток входа в систему, попробуйте снова через %minutes% минут.</target>
79+
<target>Слишком много неудачных попыток входа, повторите попытку через %minutes% минуту.|Слишком много неудачных попыток входа, повторите попытку через %minutes% минуты.|Слишком много неудачных попыток входа, повторите попытку через %minutes% минут.</target>
8080
</trans-unit>
8181
</body>
8282
</file>

‎src/Symfony/Component/Serializer/Normalizer/ObjectNormalizer.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Serializer/Normalizer/ObjectNormalizer.php
+11-7Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
final class ObjectNormalizer extends AbstractObjectNormalizer
3434
{
3535
private static $reflectionCache = [];
36+
private static $isReadableCache = [];
37+
private static $isWritableCache = [];
3638

3739
protected PropertyAccessorInterface $propertyAccessor;
3840
protected $propertyInfoExtractor;
@@ -170,21 +172,23 @@ protected function isAllowedAttribute($classOrObject, string $attribute, ?string
170172
if (!parent::isAllowedAttribute($classOrObject, $attribute, $format, $context)) {
171173
return false;
172174
}
175+
173176
$class = \is_object($classOrObject) ? \get_class($classOrObject) : $classOrObject;
174177

175178
if ($context['_read_attributes'] ?? true) {
176-
return $this->propertyInfoExtractor->isReadable($class, $attribute) || $this->hasAttributeAccessorMethod($class, $attribute);
177-
}
179+
if (!isset(self::$isReadableCache[$class.$attribute])) {
180+
self::$isReadableCache[$class.$attribute] = $this->propertyInfoExtractor->isReadable($class, $attribute) || $this->hasAttributeAccessorMethod($class, $attribute);
181+
}
178182

179-
if ($this->propertyInfoExtractor->isWritable($class, $attribute)) {
180-
return true;
183+
return self::$isReadableCache[$class.$attribute];
181184
}
182185

183-
if (($writeInfo = $this->writeInfoExtractor->getWriteInfo($class, $attribute)) && PropertyWriteInfo::TYPE_NONE !== $writeInfo->getType()) {
184-
return true;
186+
if (!isset(self::$isWritableCache[$class.$attribute])) {
187+
self::$isWritableCache[$class.$attribute] = $this->propertyInfoExtractor->isWritable($class, $attribute)
188+
|| (($writeInfo = $this->writeInfoExtractor->getWriteInfo($class, $attribute)) && PropertyWriteInfo::TYPE_NONE !== $writeInfo->getType());
185189
}
186190

187-
return false;
191+
return self::$isWritableCache[$class.$attribute];
188192
}
189193

190194
private function hasAttributeAccessorMethod(string $class, string $attribute): bool

‎src/Symfony/Component/Validator/Resources/translations/validators.ja.xlf

Copy file name to clipboardExpand all lines: src/Symfony/Component/Validator/Resources/translations/validators.ja.xlf
+7-7Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@
136136
</trans-unit>
137137
<trans-unit id="37" resname="This is not a valid IP address.">
138138
<source>This value is not a valid IP address.</source>
139-
<target state="needs-review-translation">この値は有効なIPアドレスではありません。</target>
139+
<target>有効なIPアドレスではありません。</target>
140140
</trans-unit>
141141
<trans-unit id="38">
142142
<source>This value is not a valid language.</source>
@@ -192,7 +192,7 @@
192192
</trans-unit>
193193
<trans-unit id="51" resname="No temporary folder was configured in php.ini.">
194194
<source>No temporary folder was configured in php.ini, or the configured folder does not exist.</source>
195-
<target state="needs-review-translation">php.iniに一時フォルダが設定されていないか、設定されたフォルダが存在しません。</target>
195+
<target>php.iniに一時フォルダが設定されていないか、設定されたフォルダが存在しません。</target>
196196
</trans-unit>
197197
<trans-unit id="52">
198198
<source>Cannot write temporary file to disk.</source>
@@ -224,7 +224,7 @@
224224
</trans-unit>
225225
<trans-unit id="59" resname="This is not a valid International Bank Account Number (IBAN).">
226226
<source>This value is not a valid International Bank Account Number (IBAN).</source>
227-
<target state="needs-review-translation">この値は有効な国際銀行口座番号(IBAN)ではありません。</target>
227+
<target>有効な国際銀行勘定番号(IBAN)ではありません。</target>
228228
</trans-unit>
229229
<trans-unit id="60">
230230
<source>This value is not a valid ISBN-10.</source>
@@ -312,15 +312,15 @@
312312
</trans-unit>
313313
<trans-unit id="81" resname="This is not a valid Business Identifier Code (BIC).">
314314
<source>This value is not a valid Business Identifier Code (BIC).</source>
315-
<target state="needs-review-translation">この値は有効なビジネス識別コード(BIC)ではありません。</target>
315+
<target>有効なSWIFTコードではありません。</target>
316316
</trans-unit>
317317
<trans-unit id="82">
318318
<source>Error</source>
319319
<target>エラー</target>
320320
</trans-unit>
321321
<trans-unit id="83" resname="This is not a valid UUID.">
322322
<source>This value is not a valid UUID.</source>
323-
<target state="needs-review-translation">この値は有効なUUIDではありません。</target>
323+
<target>有効なUUIDではありません。</target>
324324
</trans-unit>
325325
<trans-unit id="84">
326326
<source>This value should be a multiple of {{ compared_value }}.</source>
@@ -436,11 +436,11 @@
436436
</trans-unit>
437437
<trans-unit id="112">
438438
<source>This value is not a valid MAC address.</source>
439-
<target state="needs-review-translation">この値は有効なMACアドレスではありません。</target>
439+
<target>有効なMACアドレスではありません。</target>
440440
</trans-unit>
441441
<trans-unit id="113">
442442
<source>This URL is missing a top-level domain.</source>
443-
<target state="needs-review-translation">このURLはトップレベルドメインがありません。</target>
443+
<target>このURLはトップレベルドメインがありません。</target>
444444
</trans-unit>
445445
</body>
446446
</file>

‎src/Symfony/Component/VarExporter/ProxyHelper.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/VarExporter/ProxyHelper.php
+23-7Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -219,12 +219,14 @@ public static function exportSignature(\ReflectionFunctionAbstract $function, bo
219219
$args = '';
220220
$param = null;
221221
$parameters = [];
222+
$namespace = $function instanceof \ReflectionMethod ? $function->class : $function->getNamespaceName().'\\';
223+
$namespace = substr($namespace, 0, strrpos($namespace, '\\') ?: 0);
222224
foreach ($function->getParameters() as $param) {
223225
$parameters[] = ($param->getAttributes(\SensitiveParameter::class) ? '#[\SensitiveParameter] ' : '')
224226
.($withParameterTypes && $param->hasType() ? self::exportType($param).' ' : '')
225227
.($param->isPassedByReference() ? '&' : '')
226228
.($param->isVariadic() ? '...' : '').'$'.$param->name
227-
.($param->isOptional() && !$param->isVariadic() ? ' = '.self::exportDefault($param) : '');
229+
.($param->isOptional() && !$param->isVariadic() ? ' = '.self::exportDefault($param, $namespace) : '');
228230
if ($param->isPassedByReference()) {
229231
$byRefIndex = 1 + $param->getPosition();
230232
}
@@ -333,7 +335,7 @@ private static function exportPropertyScopes(string $parent): string
333335
return $propertyScopes;
334336
}
335337

336-
private static function exportDefault(\ReflectionParameter $param): string
338+
private static function exportDefault(\ReflectionParameter $param, $namespace): string
337339
{
338340
$default = rtrim(substr(explode('$'.$param->name.' = ', (string) $param, 2)[1] ?? '', 0, -2));
339341

@@ -347,26 +349,40 @@ private static function exportDefault(\ReflectionParameter $param): string
347349
$regexp = "/(\"(?:[^\"\\\\]*+(?:\\\\.)*+)*+\"|'(?:[^'\\\\]*+(?:\\\\.)*+)*+')/";
348350
$parts = preg_split($regexp, $default, -1, \PREG_SPLIT_DELIM_CAPTURE | \PREG_SPLIT_NO_EMPTY);
349351

350-
$regexp = '/([\[\( ]|^)([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*+(?:\\\\[a-zA-Z0-9_\x7f-\xff]++)*+)(?!: )/';
352+
$regexp = '/([\[\( ]|^)([a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*+(?:\\\\[a-zA-Z0-9_\x7f-\xff]++)*+)(\(?)(?!: )/';
351353
$callback = (false !== strpbrk($default, "\\:('") && $class = $param->getDeclaringClass())
352354
? fn ($m) => $m[1].match ($m[2]) {
353355
'new', 'false', 'true', 'null' => $m[2],
354356
'NULL' => 'null',
355357
'self' => '\\'.$class->name,
356358
'namespace\\parent',
357359
'parent' => ($parent = $class->getParentClass()) ? '\\'.$parent->name : 'parent',
358-
default => '\\'.$m[2],
359-
}
360+
default => self::exportSymbol($m[2], '(' !== $m[3], $namespace),
361+
}.$m[3]
360362
: fn ($m) => $m[1].match ($m[2]) {
361363
'new', 'false', 'true', 'null', 'self', 'parent' => $m[2],
362364
'NULL' => 'null',
363-
default => '\\'.$m[2],
364-
};
365+
default => self::exportSymbol($m[2], '(' !== $m[3], $namespace),
366+
}.$m[3];
365367

366368
return implode('', array_map(fn ($part) => match ($part[0]) {
367369
'"' => $part, // for internal classes only
368370
"'" => false !== strpbrk($part, "\\\0\r\n") ? '"'.substr(str_replace(['$', "\0", "\r", "\n"], ['\$', '\0', '\r', '\n'], $part), 1, -1).'"' : $part,
369371
default => preg_replace_callback($regexp, $callback, $part),
370372
}, $parts));
371373
}
374+
375+
private static function exportSymbol(string $symbol, bool $mightBeRootConst, string $namespace): string
376+
{
377+
if (!$mightBeRootConst
378+
|| false === ($ns = strrpos($symbol, '\\'))
379+
|| substr($symbol, 0, $ns) !== $namespace
380+
|| \defined($symbol)
381+
|| !\defined(substr($symbol, $ns + 1))
382+
) {
383+
return '\\'.$symbol;
384+
}
385+
386+
return '\\'.substr($symbol, $ns + 1);
387+
}
372388
}

‎src/Symfony/Component/VarExporter/Tests/ProxyHelperTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/VarExporter/Tests/ProxyHelperTest.php
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ public static function provideExportSignature()
3737
$expected = str_replace(['.', ' . . . ', '\'$a\', \'$a\n\', "\$a\n"'], [' . ', '...', '\'$a\', "\$a\\\n", "\$a\n"'], $expected);
3838
$expected = str_replace('Bar', '\\'.Bar::class, $expected);
3939
$expected = str_replace('self', '\\'.TestForProxyHelper::class, $expected);
40+
$expected = str_replace('= [namespace\\M_PI, new M_PI]', '= [\M_PI, new \Symfony\Component\VarExporter\Tests\M_PI()]', $expected);
4041

4142
yield [$expected, $method];
4243
}
@@ -237,6 +238,10 @@ public static function foo8()
237238
public function foo9($a = self::BOB, $b = ['$a', '$a\n', "\$a\n"], $c = ['$a', '$a\n', "\$a\n", new \stdClass()])
238239
{
239240
}
241+
242+
public function foo10($a = [namespace\M_PI, new M_PI()])
243+
{
244+
}
240245
}
241246

242247
interface TestForProxyHelperInterface1

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.