8000 Merge branch '6.4' into 7.0 · symfony/symfony@4643ea8 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4643ea8

Browse files
committed
Merge branch '6.4' into 7.0
* 6.4: [Filesystem] Fix str_contains deprecation [Security] Correctly initialize the voter property [ErrorHandler] Skip failing tests when "xdebug.file_link_format" option is defined [FrameworkBundle] Fix typo Update `changed-translation-files` step with native git diff command [DependencyInjection] fix XmlDumper when a tag contains also a 'name' property [Lock] Check the correct SQLSTATE error code for MySQL [ErrorHandler] Fix `ErrorHandlerTest::tearDown()` visibility [Lock] compatiblity with redis cluster 7 fix: typo [Messenger] trigger retry logic when message is a redelivery [PropertyAccess] Fix checking for missing properties add missing invalid extension error entry
2 parents b0b0b47 + 592d5f1 commit 4643ea8

File tree

23 files changed

+93
-28
lines changed

23 files changed

+93
-28
lines changed

.github/workflows/integration-tests.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,10 +215,14 @@ jobs:
215215
# sudo rm -rf .phpunit
216216
# [ -d .phpunit.bak ] && mv .phpunit.bak .phpunit
217217

218-
- uses: marceloprado/has-changed-path@v1.0.1
218+
- name: Check for changes in translation files
219219
id: changed-translation-files
220-
with:
221-
paths: src/**/Resources/translations/*.xlf
220+
run: |
221+
if git diff --quiet HEAD~1 HEAD -- 'src/**/Resources/translations/*.xlf'; then
222+
echo "{changed}={true}" >> $GITHUB_OUTPUT
223+
else
224+
echo "{changed}={false}" >> $GITHUB_OUTPUT
225+
fi
222226
223227
- name: Check Translation Status
224228
if: steps.changed-translation-files.outputs.changed == 'true'

src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
154154
}
155155

156156
if ($this->isNfs($realBuildDir)) {
157-
$io->note('For better performances, you should move the cache and log directories to a non-shared folder of the VM.');
157+
$io->note('For better performance, you should move the cache and log directories to a non-shared folder of the VM.');
158158
$fs->remove($realBuildDir);
159159
} else {
160160
$fs->rename($realBuildDir, $oldBuildDir);

src/Symfony/Bundle/SecurityBundle/DataCollector/SecurityDataCollector.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ public function collect(Request $request, Response $response, ?\Throwable $excep
131131
// collect voters and access decision manager information
132132
if ($this->accessDecisionManager instanceof TraceableAccessDecisionManager) {
133133
$this->data['voter_strategy'] = $this->accessDecisionManager->getStrategy();
134+
$this->data['voters'] = [];
134135

135136
foreach ($this->accessDecisionManager->getVoters() as $voter) {
136137
if ($voter instanceof TraceableVoter) {

src/Symfony/Bundle/SecurityBundle/Tests/DataCollector/SecurityDataCollectorTest.php

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,36 @@ public function dispatch(object $event, ?string $eventName = null): object
397397
$this->assertSame($dataCollector->getVoterStrategy(), $strategy, 'Wrong value returned by getVoterStrategy');
398398
}
399399

400+
public function testGetVotersIfAccessDecisionManagerHasNoVoters()
401+
{
402+
$strategy = MainConfiguration::STRATEGY_AFFIRMATIVE;
403+
404+
$accessDecisionManager = $this->createMock(TraceableAccessDecisionManager::class);
405+
406+
$accessDecisionManager
407+
->method('getStrategy')
408+
->willReturn($strategy);
409+
410+
$accessDecisionManager
411+
->method('getVoters')
412+
->willReturn([]);
413+
414+
$accessDecisionManager
415+
->method('getDecisionLog')
416+
->willReturn([[
417+
'attributes' => ['view'],
418+
'object' => new \stdClass(),
419+
'result' => true,
420+
'voterDetails' => [],
421+
]]);
422+
423+
$dataCollector = new SecurityDataCollector(null, null, null, $accessDecisionManager, null, null, true);
424+
425+
$dataCollector->collect(new Request(), new Response());
426+
427+
$this->assertEmpty($dataCollector->getVoters());
428+
}
429+
400430
public static function provideRoles(): array
401431
{
402432
return [

src/Symfony/Component/Cache/Adapter/PdoAdapter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ private function getServerVersion(): string
372372
private function isTableMissing(\PDOException $exception): bool
373373
{
374374
$driver = $this->getDriver();
375-
$code = $exception->getCode();
375+
$code = $exception->errorInfo ? $exception->errorInfo[1] : $exception->getCode();
376376

377377
return match ($driver) {
378378
'pgsql' => '42P01' === $code,

src/Symfony/Component/DependencyInjection/Dumper/XmlDumper.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,16 +134,17 @@ private function addService(Definition $definition, ?string $id, \DOMElement $pa
134134
foreach ($tags as $name => $tags) {
135135
foreach ($tags as $attributes) {
136136
$tag = $this->document->createElement('tag');
137-
if (!\array_key_exists('name', $attributes)) {
138-
$tag->setAttribute('name', $name);
139-
} else {
140-
$tag->appendChild($this->document->createTextNode($name));
141-
}
142137

143138
// Check if we have recursive attributes
144139
if (array_filter($attributes, \is_array(...))) {
140+
$tag->setAttribute('name', $name);
145141
$this->addTagRecursiveAttributes($tag, $attributes);
146142
} else {
143+
if (!\array_key_exists('name', $attributes)) {
144+
$tag->setAttribute('name', $name);
145+
} else {
146+
$tag->appendChild($this->document->createTextNode($name));
147+
}
147148
foreach ($attributes as $key => $value) {
148149
$tag->setAttribute($key, $value ?? '');
149150
}

src/Symfony/Component/DependencyInjection/Tests/Fixtures/containers/container_non_scalar_tags.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
$container
1111
->register('foo', FooClass::class)
1212
->addTag('foo_tag', [
13+
'name' => 'attributeName',
1314
'foo' => 'bar',
1415
'bar' => [
1516
'foo' => 'bar',

src/Symfony/Component/DependencyInjection/Tests/Fixtures/xml/services_with_array_tags.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<service id="service_container" class="Symfony\Component\DependencyInjection\ContainerInterface" public="true" synthetic="true"/>
55
<service id="foo" class="Bar\FooClass">
66
<tag name="foo_tag">
7+
<attribute name="name">attributeName</attribute>
78
<attribute name="foo">bar</attribute>
89
<attribute name="bar">
910
<attribute name="foo">bar</attribute>

src/Symfony/Component/DependencyInjection/Tests/Fixtures/yaml/services_with_array_tags.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ services:
77
foo:
88
class: Bar\FooClass
99
tags:
10-
- foo_tag: { foo: bar, bar: { foo: bar, bar: foo } }
10+
- foo_tag: { name: attributeName, foo: bar, bar: { foo: bar, bar: foo } }

src/Symfony/Component/DependencyInjection/Tests/Loader/XmlFileLoaderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ public function testParseServiceTagsWithArrayAttributes()
460460
$loader = new XmlFileLoader($container, new FileLocator(self::$fixturesPath.'/xml'));
461461
$loader->load('services_with_array_tags.xml');
462462

463-
$this->assertEquals(['foo_tag' => [['foo' => 'bar', 'bar' => ['foo' => 'bar', 'bar' => 'foo']]]], $container->getDefinition('foo')->getTags());
463+
$this->assertEquals(['foo_tag' => [['name' => 'attributeName', 'foo' => 'bar', 'bar' => ['foo' => 'bar', 'bar' => 'foo']]]], $container->getDefinition('foo')->getTags());
464464
}
465465

466466
public function testParseTagsWithoutNameThrowsException()

0 commit comments

Comments
 (0)
0