Skip to content

Commit af68b6e

Browse files
committed
Merge branch '6.4' into 7.1
* 6.4: Remove comment about AppVeyor in `phpunit` [Webhook][RemoteEvent] fix SendgridPayloadConverter category support Update old Appveyor skip conditions sync the Dutch translation file with changes from the 7.2 branch [Yaml] fix inline notation with inline comment fix(property-info): make sure that SerializerExtractor returns null for invalid class metadata [RemoteEvent][Webhook] fix SendgridRequestParser & SendgridPayloadConverter in case of missing sg_message_id fix_50486 - memory leak
2 parents 75303aa + 8d5be07 commit af68b6e

File tree

12 files changed

+82
-37
lines changed

12 files changed

+82
-37
lines changed

phpunit

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
#!/usr/bin/env php
22
<?php
33

4-
// Cache-Id: 2021-05-27 20:30 UTC
5-
// For caching to work properly on appveyor, this file
6-
// must be exactly the same in all maintained branches
7-
84
if (!file_exists(__DIR__.'/vendor/symfony/phpunit-bridge/bin/simple-phpunit')) {
95
echo "Unable to find the `simple-phpunit` script in `vendor/symfony/phpunit-bridge/bin/`.\nPlease run `composer update` before running this command.\n";
106
exit(1);

src/Symfony/Component/Mailer/Bridge/Sendgrid/RemoteEvent/SendgridPayloadConverter.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function convert(array $payload): AbstractMailerEvent
3131
'deferred' => MailerDeliveryEvent::DEFERRED,
3232
'bounce' => MailerDeliveryEvent::BOUNCE,
3333
};
34-
$event = new MailerDeliveryEvent($name, $payload['sg_message_id'], $payload);
34+
$event = new MailerDeliveryEvent($name, $payload['sg_message_id'] ?? $payload['sg_event_id'], $payload);
3535
$event->setReason($payload['reason'] ?? '');
3636
} else {
3737
$name = match ($payload['event']) {
@@ -41,7 +41,7 @@ public function convert(array $payload): AbstractMailerEvent
4141
'spamreport' => MailerEngagementEvent::SPAM,
4242
default => throw new ParseException(sprintf('Unsupported event "%s".', $payload['event'])),
4343
};
44-
$event = new MailerEngagementEvent($name, $payload['sg_message_id'], $payload);
44+
$event = new MailerEngagementEvent($name, $payload['sg_message_id'] ?? $payload['sg_event_id'], $payload);
4545
}
4646

4747
if (!$date = \DateTimeImmutable::createFromFormat('U', $payload['timestamp'])) {
@@ -51,7 +51,7 @@ public function convert(array $payload): AbstractMailerEvent
5151
$event->setDate($date);
5252
$event->setRecipientEmail($payload['email']);
5353
$event->setMetadata([]);
54-
$event->setTags($payload['category'] ?? []);
54+
$event->setTags((array) ($payload['category'] ?? []));
5555

5656
return $event;
5757
}

src/Symfony/Component/Mailer/Bridge/Sendgrid/Tests/RemoteEvent/SendgridPayloadConverterTest.php

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,4 +97,35 @@ public function testInvalidDate()
9797
'email' => 'test@example.com',
9898
]);
9999
}
100+
101+
public function testAsynchronousBounce()
102+
{
103+
$converter = new SendgridPayloadConverter();
104+
105+
$event = $converter->convert([
106+
'event' => 'bounce',
107+
'sg_event_id' => '123456',
108+
'timestamp' => '123456789',
109+
'email' => 'test@example.com',
110+
]);
111+
112+
$this->assertInstanceOf(MailerDeliveryEvent::class, $event);
113+
$this->assertSame('123456', $event->getId());
114+
}
115+
116+
public function testWithStringCategory()
117+
{
118+
$converter = new SendgridPayloadConverter();
119+
120+
$event = $converter->convert([
121+
'event' => 'processed',
122+
'sg_message_id' => '123456',
123+
'timestamp' => '123456789',
124+
'email' => 'test@example.com',
125+
'category' => 'cat facts',
126+
]);
127+
128+
$this->assertInstanceOf(MailerDeliveryEvent::class, $event);
129+
$this->assertSame(['cat facts'], $event->getTags());
130+
}
100131
}

src/Symfony/Component/Mailer/Bridge/Sendgrid/Webhook/SendgridRequestParser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ protected function doParse(Request $request, string $secret): ?AbstractMailerEve
4848
!isset($content[0]['email'])
4949
|| !isset($content[0]['timestamp'])
5050
|| !isset($content[0]['event'])
51-
|| !isset($content[0]['sg_message_id'])
51+
|| !isset($content[0]['sg_event_id'])
5252
) {
5353
throw new RejectWebhookException(406, 'Payload is malformed.');
5454
}

src/Symfony/Component/Mailer/Transport/SendmailTransport.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ protected function doSend(SentMessage $message): void
114114
$this->stream->setCommand($command);
115115
$this->stream->initialize();
116116
foreach ($chunks as $chunk) {
117-
$this->stream->write($chunk);
117+
$this->stream->write($chunk, false);
118118
}
119119
$this->stream->flush();
120120
$this->stream->terminate();

src/Symfony/Component/PropertyInfo/Extractor/SerializerExtractor.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function getProperties(string $class, array $context = []): ?array
3434
return null;
3535
}
3636

37-
if (!$this->classMetadataFactory->getMetadataFor($class)) {
37+
if (!$this->classMetadataFactory->hasMetadataFor($class)) {
3838
return null;
3939
}
4040

src/Symfony/Component/PropertyInfo/Tests/Extractor/SerializerExtractorTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,9 @@ public function testGetPropertiesWithAnyGroup()
4949
{
5050
$this->assertSame(['analyses', 'feet'], $this->extractor->getProperties(AdderRemoverDummy::class, ['serializer_groups' => null]));
5151
}
52+
53+
public function testGetPropertiesWithNonExistentClassReturnsNull()
54+
{
55+
$this->assertSame(null, $this->extractor->getProperties('NonExistent'));
56+
}
5257
}

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

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,15 @@
7676
</trans-unit>
7777
<trans-unit id="19">
7878
<source>This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less.</source>
79-
<target>Deze waarde is te lang. Hij mag maximaal {{ limit }} teken bevatten.|Deze waarde is te lang. Hij mag maximaal {{ limit }} tekens bevatten.</target>
79+
<target>Deze waarde is te lang. Deze mag maximaal één teken bevatten.|Deze waarde is te lang. Deze mag maximaal {{ limit }} tekens bevatten.</target>
8080
</trans-unit>
8181
<trans-unit id="20">
8282
<source>This value should be {{ limit }} or more.</source>
8383
<target>Deze waarde moet {{ limit }} of meer zijn.</target>
8484
</trans-unit>
8585
<trans-unit id="21">
8686
<source>This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more.</source>
87-
<target>Deze waarde is te kort. Hij moet tenminste {{ limit }} teken bevatten.|Deze waarde is te kort. Hij moet tenminste {{ limit }} tekens bevatten.</target>
87+
<target>Deze waarde is te kort. Deze moet ten minste één teken bevatten.|Deze waarde is te kort. Deze moet ten minste {{ limit }} tekens bevatten.</target>
8888
</trans-unit>
8989
<trans-unit id="22">
9090
<source>This value should not be blank.</source>
@@ -160,15 +160,15 @@
160160
</trans-unit>
161161
<trans-unit id="43">
162162
<source>The image width is too big ({{ width }}px). Allowed maximum width is {{ max_width }}px.</source>
163-
<target>De afbeelding is te breed ({{ width }}px). De maximaal breedte is {{ max_width }}px.</target>
163+
<target>De afbeelding is te breed ({{ width }}px). De maximale breedte is {{ max_width }}px.</target>
164164
</trans-unit>
165165
<trans-unit id="44">
166166
<source>The image width is too small ({{ width }}px). Minimum width expected is {{ min_width }}px.</source>
167167
<target>De afbeelding is niet breed genoeg ({{ width }}px). De minimaal verwachte breedte is {{ min_width }}px.</target>
168168
</trans-unit>
169169
<trans-unit id="45">
170170
<source>The image height is too big ({{ height }}px). Allowed maximum height is {{ max_height }}px.</source>
171-
<target>De afbeelding is te hoog ({{ height }}px). De maximaal hoogte is {{ max_height }}px.</target>
171+
<target>De afbeelding is te hoog ({{ height }}px). De maximale hoogte is {{ max_height }}px.</target>
172172
</trans-unit>
173173
<trans-unit id="46">
174174
<source>The image height is too small ({{ height }}px). Minimum height expected is {{ min_height }}px.</source>
@@ -180,7 +180,7 @@
180180
</trans-unit>
181181
<trans-unit id="48">
182182
<source>This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters.</source>
183-
<target>Deze waarde moet exact {{ limit }} teken lang zijn.|Deze waarde moet exact {{ limit }} tekens lang zijn.</target>
183+
<target>Deze waarde moet exact één teken lang zijn.|Deze waarde moet exact {{ limit }} tekens lang zijn.</target>
184184
</trans-unit>
185185
<trans-unit id="49">
186186
<source>The file was only partially uploaded.</source>
@@ -196,23 +196,23 @@
196196
</trans-unit>
197197
<trans-unit id="52">
198198
<source>Cannot write temporary file to disk.</source>
199-
<target>Kan het tijdelijke bestand niet wegschrijven op disk.</target>
199+
<target>Kan het tijdelijke bestand niet wegschrijven op de schijf.</target>
200200
</trans-unit>
201201
<trans-unit id="53">
202202
<source>A PHP extension caused the upload to fail.</source>
203203
<target>De upload is mislukt vanwege een PHP-extensie.</target>
204204
</trans-unit>
205205
<trans-unit id="54">
206206
<source>This collection should contain {{ limit }} element or more.|This collection should contain {{ limit }} elements or more.</source>
207-
<target>Deze collectie moet {{ limit }} element of meer bevatten.|Deze collectie moet {{ limit }} elementen of meer bevatten.</target>
207+
<target>Deze collectie moet één of meer elementen bevatten.|Deze collectie moet {{ limit }} of meer elementen bevatten.</target>
208208
</trans-unit>
209209
<trans-unit id="55">
210210
<source>This collection should contain {{ limit }} element or less.|This collection should contain {{ limit }} elements or less.</source>
211-
<target>Deze collectie moet {{ limit }} element of minder bevatten.|Deze collectie moet {{ limit }} elementen of minder bevatten.</target>
211+
<target>Deze collectie moet één of minder elementen bevatten.|Deze collectie moet {{ limit }} of minder elementen bevatten.</target>
212212
</trans-unit>
213213
<trans-unit id="56">
214214
<source>This collection should contain exactly {{ limit }} element.|This collection should contain exactly {{ limit }} elements.</source>
215-
<target>Deze collectie moet exact {{ limit }} element bevatten.|Deze collectie moet exact {{ limit }} elementen bevatten.</target>
215+
<target>Deze collectie moet exact één element bevatten.|Deze collectie moet exact {{ limit }} elementen bevatten.</target>
216216
</trans-unit>
217217
<trans-unit id="57">
218218
<source>Invalid card number.</source>
@@ -236,11 +236,11 @@
236236
</trans-unit>
237237
<trans-unit id="62">
238238
<source>This value is neither a valid ISBN-10 nor a valid ISBN-13.</source>
239-
<target>Deze waarde is geen geldige ISBN-10 of ISBN-13 waarde.</target>
239+
<target>Deze waarde is geen geldige ISBN-10 of ISBN-13.</target>
240240
</trans-unit>
241241
<trans-unit id="63">
242242
<source>This value is not a valid ISSN.</source>
243-
<target>Deze waarde is geen geldige ISSN waarde.</target>
243+
<target>Deze waarde is geen geldige ISSN.</target>
244244
</trans-unit>
245245
<trans-unit id="64">
246246
<source>This value is not a valid currency.</source>
@@ -256,7 +256,7 @@
256256
</trans-unit>
257257
<trans-unit id="67">
258258
<source>This value should be greater than or equal to {{ compared_value }}.</source>
259-
<target>Deze waarde moet groter dan of gelijk aan {{ compared_value }} zijn.</target>
259+
<target>Deze waarde moet groter of gelijk aan {{ compared_value }} zijn.</target>
260260
</trans-unit>
261261
<trans-unit id="68">
262262
<source>This value should be identical to {{ compared_value_type }} {{ compared_value }}.</source>
@@ -304,15 +304,15 @@
304304
</trans-unit>
305305
<trans-unit id="79">
306306
<source>The host could not be resolved.</source>
307-
<target>De hostnaam kon niet worden bepaald.</target>
307+
<target>De hostnaam kon niet worden gevonden.</target>
308308
</trans-unit>
309309
<trans-unit id="80">
310310
<source>This value does not match the expected {{ charset }} charset.</source>
311311
<target>Deze waarde is niet in de verwachte tekencodering {{ charset }}.</target>
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>Deze waarde is geen geldige zakelijke identificatiecode (BIC).</target>
315+
<target>Deze waarde is geen geldige bankidentificatiecode (BIC).</target>
316316
</trans-unit>
317317
<trans-unit id="82">
318318
<source>Error</source>
@@ -328,7 +328,7 @@
328328
</trans-unit>
329329
<trans-unit id="85">
330330
<source>This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}.</source>
331-
<target>Deze bedrijfsidentificatiecode (BIC) is niet gekoppeld aan IBAN {{ iban }}.</target>
331+
<target>Deze bankidentificatiecode (BIC) is niet gekoppeld aan IBAN {{ iban }}.</target>
332332
</trans-unit>
333333
<trans-unit id="86">
334334
<source>This value should be valid JSON.</source>
@@ -360,7 +360,7 @@
360360
</trans-unit>
361361
<trans-unit id="93">
362362
<source>This password has been leaked in a data breach, it must not be used. Please use another password.</source>
363-
<target>Dit wachtwoord is gelekt vanwege een data-inbreuk, het moet niet worden gebruikt. Kies een ander wachtwoord.</target>
363+
<target>Dit wachtwoord is gelekt bij een datalek en mag niet worden gebruikt. Kies een ander wachtwoord.</target>
364364
</trans-unit>
365365
<trans-unit id="94">
366366
<source>This value should be between {{ min }} and {{ max }}.</source>
@@ -400,11 +400,11 @@
400400
</trans-unit>
401401
<trans-unit id="103">
402402
<source>The value of the netmask should be between {{ min }} and {{ max }}.</source>
403-
<target>De waarde van de netmask moet zich tussen {{ min }} en {{ max }} bevinden.</target>
403+
<target>De waarde van het netmasker moet tussen {{ min }} en {{ max }} liggen.</target>
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>De bestandsnaam is te lang. Het moet {{ filename_max_length }} karakter of minder zijn.|De bestandsnaam is te lang. Het moet {{ filename_max_length }} karakters of minder zijn.</target>
407+
<target>De bestandsnaam is te lang. Het moet {{ filename_max_length }} of minder karakters zijn.|De bestandsnaam is te lang. Het moet {{ filename_max_length }} of minder karakters zijn.</target>
408408
</trans-unit>
409409
<trans-unit id="105">
410410
<source>The password strength is too low. Please use a stronger password.</source>
@@ -452,19 +452,19 @@
452452
</trans-unit>
453453
<trans-unit id="116">
454454
<source>This value does not represent a valid week in the ISO 8601 format.</source>
455-
<target state="needs-review-translation">Deze waarde vertegenwoordigt geen geldige week in het ISO 8601-formaat.</target>
455+
<target>Deze waarde vertegenwoordigt geen geldige week in het ISO 8601-formaat.</target>
456456
</trans-unit>
457457
<trans-unit id="117">
458458
<source>This value is not a valid week.</source>
459-
<target state="needs-review-translation">Deze waarde is geen geldige week.</target>
459+
<target>Deze waarde is geen geldige week.</target>
460460
</trans-unit>
461461
<trans-unit id="118">
462462
<source>This value should not be before week "{{ min }}".</source>
463-
<target state="needs-review-translation">Deze waarde mag niet voor week "{{ min }}" zijn.</target>
463+
<target>Deze waarde mag niet vóór week "{{ min }}" liggen.</target>
464464
</trans-unit>
465465
<trans-unit id="119">
466466
<source>This value should not be after week "{{ max }}".</source>
467-
<target state="needs-review-translation">Deze waarde mag niet na week "{{ max }}" zijn.</target>
467+
<target>Deze waarde mag niet na week "{{ max }}" liggen.</target>
468468
</trans-unit>
469469
<trans-unit id="120">
470470
<source>This value is not a valid slug.</source>

src/Symfony/Component/VarDumper/Tests/Dumper/ServerDumperTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ public function testDumpForwardsToWrappedDumperWhenServerIsUnavailable()
3939

4040
public function testDump()
4141
{
42-
if ('True' === getenv('APPVEYOR')) {
43-
$this->markTestSkipped('Skip transient test on AppVeyor');
42+
if ('\\' === \DIRECTORY_SEPARATOR) {
43+
$this->markTestSkipped('Skip transient test on Windows');
4444
}
4545

4646
$wrappedDumper = $this->createMock(DataDumperInterface::class);

src/Symfony/Component/VarDumper/Tests/Server/ConnectionTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ class ConnectionTest extends TestCase
2424

2525
public function testDump()
2626
{
27-
if ('True' === getenv('APPVEYOR')) {
28-
$this->markTestSkipped('Skip transient test on AppVeyor');
27+
if ('\\' === \DIRECTORY_SEPARATOR) {
28+
$this->markTestSkipped('Skip transient test on Windows');
2929
}
3030

3131
$cloner = new VarCloner();

0 commit comments

Comments
 (0)