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 30e559f

Browse filesBrowse files
committed
Merge branch '7.1' into 7.2
* 7.1: 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 6724c25 + af68b6e commit 30e559f
Copy full SHA for 30e559f

File tree

Expand file treeCollapse file tree

12 files changed

+64
-15
lines changed
Filter options
Expand file treeCollapse file tree

12 files changed

+64
-15
lines changed

‎phpunit

Copy file name to clipboardExpand all lines: phpunit
-4Lines 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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Mailer/Bridge/Sendgrid/RemoteEvent/SendgridPayloadConverter.php
+3-3Lines 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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Mailer/Bridge/Sendgrid/Tests/RemoteEvent/SendgridPayloadConverterTest.php
+31Lines 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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Mailer/Bridge/Sendgrid/Webhook/SendgridRequestParser.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ protected function doParse(Request $request, string $secret): array
5151
!isset($content[0]['email'])
5252
|| !isset($content[0]['timestamp'])
5353
|| !isset($content[0]['event'])
54-
|| !isset($content[0]['sg_message_id'])
54+
|| !isset($content[0]['sg_event_id'])
5555
) {
5656
throw new RejectWebhookException(406, 'Payload is malformed.');
5757
}

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Mailer/Transport/SendmailTransport.php
+1-1Lines 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

Copy file name to clipboardExpand all lines: src/Symfony/Component/PropertyInfo/Extractor/SerializerExtractor.php
+1-1Lines 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

Copy file name to clipboardExpand all lines: src/Symfony/Component/PropertyInfo/Tests/Extractor/SerializerExtractorTest.php
+5Lines 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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Validator/Resources/translations/validators.nl.xlf
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,10 @@
466466
<source>This value should not be after week "{{ max }}".</source>
467467
<target>Deze waarde mag niet na week "{{ max }}" liggen.</target>
468468
</trans-unit>
469+
<trans-unit id="120">
470+
<source>This value is not a valid slug.</source>
471+
<target state="needs-review-translation">Deze waarde is geen geldige slug.</target>
472+
</trans-unit>
469473
</body>
470474
</file>
471475
</xliff>

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

Copy file name to clipboardExpand all lines: src/Symfony/Component/VarDumper/Tests/Dumper/ServerDumperTest.php
+2-2Lines 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

Copy file name to clipboardExpand all lines: src/Symfony/Component/VarDumper/Tests/Server/ConnectionTest.php
+2-2Lines 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();

‎src/Symfony/Component/Yaml/Parser.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Yaml/Parser.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1213,7 +1213,7 @@ private function lexInlineStructure(int &$cursor, string $closingTag, bool $cons
12131213
$value .= $this->currentLine[$cursor];
12141214
++$cursor;
12151215

1216-
if ($consumeUntilEol && isset($this->currentLine[$cursor]) && (strspn($this->currentLine, ' ', $cursor) + $cursor) < strlen($this->currentLine)) {
1216+
if ($consumeUntilEol && isset($this->currentLine[$cursor]) && ($whitespaces = strspn($this->currentLine, ' ', $cursor) + $cursor) < strlen($this->currentLine) && '#' !== $this->currentLine[$whitespaces]) {
12171217
throw new ParseException(sprintf('Unexpected token "%s".', trim(substr($this->currentLine, $cursor))));
12181218
}
12191219

‎src/Symfony/Component/Yaml/Tests/ParserTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Yaml/Tests/ParserTest.php
+13Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2178,6 +2178,19 @@ public static function inlineNotationSpanningMultipleLinesProvider(): array
21782178
<<<YAML
21792179
map: {key: "value", a: "b"}
21802180
param: "some"
2181+
YAML
2182+
],
2183+
'mixed mapping with inline notation on one line with a comment' => [
2184+
[
2185+
'map' => [
2186+
'key' => 'value',
2187+
'a' => 'b',
2188+
],
2189+
'param' => 'some',
2190+
],
2191+
<<<YAML
2192+
map: {key: "value", a: "b"} # comment
2193+
param: "some"
21812194
YAML
21822195
],
21832196
'mixed mapping with compact inline notation on one line' => [

0 commit comments

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