Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commitcfe62c5

Browse files
committed
Merge branch '6.4' into 7.2
* 6.4: remove an invalid test [Translation] fix support of `TranslatableInterface` in `IdentityTranslator` Fix various bool-type coercions
2 parentsbb543a0 +152d788 commitcfe62c5

File tree

22 files changed

+65
-58
lines changed

22 files changed

+65
-58
lines changed

‎src/Symfony/Bridge/Twig/Tests/Extension/Fixtures/StubTranslator.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,19 @@
1111

1212
namespaceSymfony\Bridge\Twig\Tests\Extension\Fixtures;
1313

14+
useSymfony\Contracts\Translation\TranslatableInterface;
1415
useSymfony\Contracts\Translation\TranslatorInterface;
1516

1617
class StubTranslatorimplements TranslatorInterface
1718
{
1819
publicfunctiontrans($id,array$parameters = [],$domain =null,$locale =null):string
1920
{
21+
foreach ($parametersas$k =>$v) {
22+
if ($vinstanceof TranslatableInterface) {
23+
$parameters[$k] =$v->trans($this,$locale);
24+
}
25+
}
26+
2027
return'[trans]'.strtr($id,$parameters).'[/trans]';
2128
}
2229

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ private function generateSignature(\ReflectionClass $class): iterable
122122
yieldprint_r($attributes,true);
123123
$attributes = [];
124124

125-
yield$class->getDocComment();
125+
yield$class->getDocComment() ?:'';
126126
yield (int)$class->isFinal();
127127
yield (int)$class->isAbstract();
128128

@@ -144,7 +144,7 @@ private function generateSignature(\ReflectionClass $class): iterable
144144
yieldprint_r($attributes,true);
145145
$attributes = [];
146146

147-
yield$p->getDocComment();
147+
yield$p->getDocComment() ?:'';
148148
yield$p->isDefault() ?'<default>' :'';
149149
yield$p->isPublic() ?'public' :'protected';
150150
yield$p->isStatic() ?'static' :'';

‎src/Symfony/Component/Config/Tests/Builder/GeneratedConfigTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,8 @@ private function assertDirectorySame($expected, $current)
193193
}
194194
$currentFiles[substr($file->getPathname(),\strlen($current))] =$file->getPathname();
195195
}
196+
ksort($expectedFiles);
197+
ksort($currentFiles);
196198

197199
$this->assertSame(array_keys($expectedFiles),array_keys($currentFiles));
198200
foreach ($expectedFilesas$fileName =>$filePath) {

‎src/Symfony/Component/DependencyInjection/ContainerBuilder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1175,7 +1175,7 @@ private function createService(Definition $definition, array &$inlineServices, b
11751175
if (!$definition->isDeprecated() &&\is_array($factory) &&\is_string($factory[0])) {
11761176
$r =new \ReflectionClass($factory[0]);
11771177

1178-
if (0 <strpos($r->getDocComment(),"\n * @deprecated")) {
1178+
if (0 <strpos($r->getDocComment() ?:'',"\n * @deprecated")) {
11791179
trigger_deprecation('','','The "%s" service relies on the deprecated "%s" factory class. It should either be deprecated or its factory upgraded.',$id,$r->name);
11801180
}
11811181
}
@@ -1192,7 +1192,7 @@ private function createService(Definition $definition, array &$inlineServices, b
11921192
$service =$r->getConstructor() ?$r->newInstanceArgs($arguments) :$r->newInstance();
11931193
}
11941194

1195-
if (!$definition->isDeprecated() &&0 <strpos($r->getDocComment(),"\n * @deprecated")) {
1195+
if (!$definition->isDeprecated() &&0 <strpos($r->getDocComment() ?:'',"\n * @deprecated")) {
11961196
trigger_deprecation('','','The "%s" service relies on the deprecated "%s" class. It should either be deprecated or its implementation upgraded.',$id,$r->name);
11971197
}
11981198
}

‎src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ private function collectLineage(string $class, array &$lineage): void
527527
return;
528528
}
529529
$file =$r->getFileName();
530-
if (str_ends_with($file,') : eval()\'d code')) {
530+
if ($file &&str_ends_with($file,') : eval()\'d code')) {
531531
$file =substr($file,0,strrpos($file,'(', -17));
532532
}
533533
if (!$file ||$this->doExport($file) ===$exportedFile =$this->export($file)) {
@@ -574,12 +574,13 @@ private function generateProxyClasses(): array
574574
continue;
575575
}
576576
do {
577-
$file =$r->getFileName();
578-
if (str_ends_with($file,') : eval()\'d code')) {
579-
$file =substr($file,0,strrpos($file,'(', -17));
580-
}
581-
if (is_file($file)) {
582-
$this->container->addResource(newFileResource($file));
577+
if ($file =$r->getFileName()) {
578+
if (str_ends_with($file,') : eval()\'d code')) {
579+
$file =substr($file,0,strrpos($file,'(', -17));
580+
}
581+
if (is_file($file)) {
582+
$this->container->addResource(newFileResource($file));
583+
}
583584
}
584585
$r =$r->getParentClass() ?:null;
585586
}while ($r?->isUserDefined());

‎src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,11 @@ private function parseDefinition(\DOMElement $service, string $file, Definition
339339
}
340340

341341
foreach ($this->getChildren($service,'call')as$call) {
342-
$definition->addMethodCall($call->getAttribute('method'),$this->getArgumentsAsPhp($call,'argument',$file), XmlUtils::phpize($call->getAttribute('returns-clone')));
342+
$definition->addMethodCall(
343+
$call->getAttribute('method'),
344+
$this->getArgumentsAsPhp($call,'argument',$file),
345+
XmlUtils::phpize($call->getAttribute('returns-clone')) ?:false
346+
);
343347
}
344348

345349
$tags =$this->getChildren($service,'tag');

‎src/Symfony/Component/Finder/Tests/Iterator/FilecontentFilterIteratorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public static function getTestFilterData()
7272

7373
$inner[] =newMockSplFileInfo([
7474
'name' =>'unreadable-file.txt',
75-
'contents' =>false,
75+
'contents' =>'',
7676
'type' =>'file',
7777
'mode' =>'r+', ]
7878
);

‎src/Symfony/Component/Form/Tests/Extension/Core/Type/CountryTypeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class CountryTypeTest extends BaseTypeTestCase
2121

2222
protectedfunctionsetUp():void
2323
{
24-
IntlTestHelper::requireIntl($this,false);
24+
IntlTestHelper::requireIntl($this);
2525

2626
parent::setUp();
2727
}

‎src/Symfony/Component/Form/Tests/Extension/Core/Type/CurrencyTypeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class CurrencyTypeTest extends BaseTypeTestCase
2121

2222
protectedfunctionsetUp():void
2323
{
24-
IntlTestHelper::requireIntl($this,false);
24+
IntlTestHelper::requireIntl($this);
2525

2626
parent::setUp();
2727
}

‎src/Symfony/Component/Form/Tests/Extension/Core/Type/IntegerTypeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class IntegerTypeTest extends BaseTypeTestCase
2222

2323
protectedfunctionsetUp():void
2424
{
25-
IntlTestHelper::requireIntl($this,false);
25+
IntlTestHelper::requireIntl($this);
2626
$this->previousLocale = \Locale::getDefault();
2727
parent::setUp();
2828
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp