Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 07aa1ed

Browse files
committed
Merge branch '5.1' into 5.2
* 5.1: Use more explicit variable name Fix wrong comment about SES region [Mailer] [Sendgrid] Use $scheme variable to stay consistent [Mailer] [Amazon] Fix @param annotation [Mailer] Rename testsuites Remove void return type from test methods Remove void return type from test methods [Notifier] Remove void return type from test methods
2 parents cb05fab + 7d846d3 commit 07aa1ed

File tree

20 files changed

+59
-58
lines changed

20 files changed

+59
-58
lines changed

src/Symfony/Bridge/Doctrine/Tests/ContainerAwareEventManagerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ class MyListener
156156
public $calledByInvokeCount = 0;
157157
public $calledByEventNameCount = 0;
158158

159-
public function __invoke(): void
159+
public function __invoke()
160160
{
161161
++$this->calledByInvokeCount;
162162
}

src/Symfony/Bridge/Twig/Tests/Mime/BodyRendererTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@
2121

2222
class BodyRendererTest extends TestCase
2323
{
24-
public function testRenderTextOnly(): void
24+
public function testRenderTextOnly()
2525
{
2626
$email = $this->prepareEmail('Text', null);
2727
$this->assertEquals('Text', $email->getBody()->bodyToString());
2828
}
2929

30-
public function testRenderHtmlOnly(): void
30+
public function testRenderHtmlOnly()
3131
{
3232
$html = '<head>head</head><b>HTML</b><style type="text/css">css</style>';
3333
$email = $this->prepareEmail(null, $html);
@@ -37,7 +37,7 @@ public function testRenderHtmlOnly(): void
3737
$this->assertEquals(str_replace('=', '=3D', $html), $body->getParts()[1]->bodyToString());
3838
}
3939

40-
public function testRenderHtmlOnlyWithTextSet(): void
40+
public function testRenderHtmlOnlyWithTextSet()
4141
{
4242
$email = $this->prepareEmail(null, '<b>HTML</b>');
4343
$email->text('Text');
@@ -47,7 +47,7 @@ public function testRenderHtmlOnlyWithTextSet(): void
4747
$this->assertEquals('<b>HTML</b>', $body->getParts()[1]->bodyToString());
4848
}
4949

50-
public function testRenderTextAndHtml(): void
50+
public function testRenderTextAndHtml()
5151
{
5252
$email = $this->prepareEmail('Text', '<b>HTML</b>');
5353
$body = $email->getBody();
@@ -56,7 +56,7 @@ public function testRenderTextAndHtml(): void
5656
$this->assertEquals('<b>HTML</b>', $body->getParts()[1]->bodyToString());
5757
}
5858

59-
public function testRenderWithContextReservedEmailEntry(): void
59+
public function testRenderWithContextReservedEmailEntry()
6060
{
6161
$this->expectException(InvalidArgumentException::class);
6262
$this->prepareEmail('Text', '', ['email' => 'reserved!']);

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1578,7 +1578,7 @@ public function provideMailer(): array
15781578
/**
15791579
* @dataProvider provideMailer
15801580
*/
1581-
public function testMailer(string $configFile, array $expectedTransports): void
1581+
public function testMailer(string $configFile, array $expectedTransports)
15821582
{
15831583
$container = $this->createContainerFromFile($configFile);
15841584

@@ -1599,14 +1599,14 @@ public function testMailer(string $configFile, array $expectedTransports): void
15991599
$this->assertCount(3, $h->getMethodCalls());
16001600
}
16011601

1602-
public function testMailerWithDisabledMessageBus(): void
1602+
public function testMailerWithDisabledMessageBus()
16031603
{
16041604
$container = $this->createContainerFromFile('mailer_with_disabled_message_bus');
16051605

16061606
$this->assertNull($container->getDefinition('mailer.mailer')->getArgument(1));
16071607
}
16081608

1609-
public function testMailerWithSpecificMessageBus(): void
1609+
public function testMailerWithSpecificMessageBus()
16101610
{
16111611
$container = $this->createContainerFromFile('mailer_with_specific_message_bus');
16121612

src/Symfony/Bundle/SecurityBundle/Tests/Functional/EventAliasTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
final class EventAliasTest extends AbstractWebTestCase
2626
{
27-
public function testAliasedEvents(): void
27+
public function testAliasedEvents()
2828
{
2929
$client = $this->createClient(['test_case' => 'AliasedEvents', 'root_config' => 'config.yml']);
3030
$container = $client->getContainer();

src/Symfony/Component/Console/Tests/Helper/ProgressBarTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -872,7 +872,7 @@ public function provideFormat(): array
872872
];
873873
}
874874

875-
public function testIterate(): void
875+
public function testIterate()
876876
{
877877
$bar = new ProgressBar($output = $this->getOutputStream(), 0, 0);
878878

@@ -887,7 +887,7 @@ public function testIterate(): void
887887
);
888888
}
889889

890-
public function testIterateUncountable(): void
890+
public function testIterateUncountable()
891891
{
892892
$bar = new ProgressBar($output = $this->getOutputStream(), 0, 0);
893893

@@ -936,7 +936,7 @@ public function testBarWidthWithMultilineFormat()
936936
putenv('COLUMNS=120');
937937
}
938938

939-
public function testMinAndMaxSecondsBetweenRedraws(): void
939+
public function testMinAndMaxSecondsBetweenRedraws()
940940
{
941941
$bar = new ProgressBar($output = $this->getOutputStream());
942942
$bar->setRedrawFrequency(1);
@@ -959,7 +959,7 @@ public function testMinAndMaxSecondsBetweenRedraws(): void
959959
);
960960
}
961961

962-
public function testMaxSecondsBetweenRedraws(): void
962+
public function testMaxSecondsBetweenRedraws()
963963
{
964964
$bar = new ProgressBar($output = $this->getOutputStream(), 0, 0);
965965
$bar->setRedrawFrequency(4); // disable step based redraws
@@ -1014,7 +1014,7 @@ public function testMinSecondsBetweenRedraws()
10141014
);
10151015
}
10161016

1017-
public function testNoWriteWhenMessageIsSame(): void
1017+
public function testNoWriteWhenMessageIsSame()
10181018
{
10191019
$bar = new ProgressBar($output = $this->getOutputStream(), 2);
10201020
$bar->start();

src/Symfony/Component/Form/Tests/Extension/Core/DataTransformer/StringToFloatTransformerTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,21 @@ public function provideTransformations(): array
3030
/**
3131
* @dataProvider provideTransformations
3232
*/
33-
public function testTransform($from, $to): void
33+
public function testTransform($from, $to)
3434
{
3535
$transformer = new StringToFloatTransformer();
3636

3737
$this->assertSame($to, $transformer->transform($from));
3838
}
3939

40-
public function testFailIfTransformingANonString(): void
40+
public function testFailIfTransformingANonString()
4141
{
4242
$this->expectException('Symfony\Component\Form\Exception\TransformationFailedException');
4343
$transformer = new StringToFloatTransformer();
4444
$transformer->transform(1.0);
4545
}
4646

47-
public function testFailIfTransformingANonNumericString(): void
47+
public function testFailIfTransformingANonNumericString()
4848
{
4949
$this->expectException('Symfony\Component\Form\Exception\TransformationFailedException');
5050
$transformer = new StringToFloatTransformer();
@@ -70,14 +70,14 @@ public function provideReverseTransformations(): array
7070
/**
7171
* @dataProvider provideReverseTransformations
7272
*/
73-
public function testReverseTransform($from, $to, int $scale = null): void
73+
public function testReverseTransform($from, $to, int $scale = null)
7474
{
7575
$transformer = new StringToFloatTransformer($scale);
7676

7777
$this->assertSame($to, $transformer->reverseTransform($from));
7878
}
7979

80-
public function testFailIfReverseTransformingANonNumeric(): void
80+
public function testFailIfReverseTransformingANonNumeric()
8181
{
8282
$this->expectException('Symfony\Component\Form\Exception\TransformationFailedException');
8383
$transformer = new StringToFloatTransformer();

src/Symfony/Component/Form/Tests/Extension/Core/Type/NumberTypeTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,39 +37,39 @@ protected function tearDown(): void
3737
\Locale::setDefault($this->defaultLocale);
3838
}
3939

40-
public function testDefaultFormatting(): void
40+
public function testDefaultFormatting()
4141
{
4242
$form = $this->factory->create(static::TESTED_TYPE);
4343
$form->setData('12345.67890');
4444

4545
$this->assertSame('12345,679', $form->createView()->vars['value']);
4646
}
4747

48-
public function testDefaultFormattingWithGrouping(): void
48+
public function testDefaultFormattingWithGrouping()
4949
{
5050
$form = $this->factory->create(static::TESTED_TYPE, null, ['grouping' => true]);
5151
$form->setData('12345.67890');
5252

5353
$this->assertSame('12.345,679', $form->createView()->vars['value']);
5454
}
5555

56-
public function testDefaultFormattingWithScale(): void
56+
public function testDefaultFormattingWithScale()
5757
{
5858
$form = $this->factory->create(static::TESTED_TYPE, null, ['scale' => 2]);
5959
$form->setData('12345.67890');
6060

6161
$this->assertSame('12345,68', $form->createView()->vars['value']);
6262
}
6363

64-
public function testDefaultFormattingWithScaleFloat(): void
64+
public function testDefaultFormattingWithScaleFloat()
6565
{
6666
$form = $this->factory->create(static::TESTED_TYPE, null, ['scale' => 2]);
6767
$form->setData(12345.67890);
6868

6969
$this->assertSame('12345,68', $form->createView()->vars['value']);
7070
}
7171

72-
public function testDefaultFormattingWithScaleAndStringInput(): void
72+
public function testDefaultFormattingWithScaleAndStringInput()
7373
{
7474
$form = $this->factory->create(static::TESTED_TYPE, null, ['scale' => 2, 'input' => 'string']);
7575
$form->setData('12345.67890');

src/Symfony/Component/HttpKernel/Tests/KernelTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,7 @@ public function testKernelStartTimeIsResetWhileBootingAlreadyBootedKernel()
586586
$this->assertGreaterThan($preReBoot, $kernel->getStartTime());
587587
}
588588

589-
public function testAnonymousKernelGeneratesValidContainerClass(): void
589+
public function testAnonymousKernelGeneratesValidContainerClass()
590590
{
591591
$kernel = new class('test', true) extends Kernel {
592592
public function registerBundles(): iterable

src/Symfony/Component/Mailer/Bridge/Amazon/Transport/SesApiTransport.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class SesApiTransport extends AbstractApiTransport
3535
private $region;
3636

3737
/**
38-
* @param string $region Amazon SES region (currently one of us-east-1, us-west-2, or eu-west-1)
38+
* @param string|null $region Amazon SES region
3939
*/
4040
public function __construct(string $accessKey, string $secretKey, string $region = null, HttpClientInterface $client = null, EventDispatcherInterface $dispatcher = null, LoggerInterface $logger = null)
4141
{

src/Symfony/Component/Mailer/Bridge/Amazon/Transport/SesHttpTransport.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class SesHttpTransport extends AbstractHttpTransport
3434
private $region;
3535

3636
/**
37-
* @param string $region Amazon SES region (currently one of us-east-1, us-west-2, or eu-west-1)
37+
* @param string|null $region Amazon SES region
3838
*/
3939
public function __construct(string $accessKey, string $secretKey, string $region = null, HttpClientInterface $client = null, EventDispatcherInterface $dispatcher = null, LoggerInterface $logger = null)
4040
{

src/Symfony/Component/Mailer/Bridge/Amazon/Transport/SesSmtpTransport.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
class SesSmtpTransport extends EsmtpTransport
2222
{
2323
/**
24-
* @param string $region Amazon SES region (currently one of us-east-1, us-west-2, or eu-west-1)
24+
* @param string|null $region Amazon SES region
2525
*/
2626
public function __construct(string $username, string $password, string $region = null, EventDispatcherInterface $dispatcher = null, LoggerInterface $logger = null)
2727
{

src/Symfony/Component/Mailer/Bridge/Amazon/phpunit.xml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
</php>
1414

1515
<testsuites>
16-
<testsuite name="Symfony Amazon Mailer Test Suite">
16+
<testsuite name="Symfony Amazon Mailer Bridge Test Suite">
1717
<directory>./Tests/</directory>
1818
</testsuite>
1919
</testsuites>

src/Symfony/Component/Mailer/Bridge/Sendgrid/Transport/SendgridTransportFactory.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,17 @@ final class SendgridTransportFactory extends AbstractTransportFactory
2323
{
2424
public function create(Dsn $dsn): TransportInterface
2525
{
26+
$scheme = $dsn->getScheme();
2627
$key = $this->getUser($dsn);
2728

28-
if ('sendgrid+api' === $dsn->getScheme()) {
29+
if ('sendgrid+api' === $scheme) {
2930
$host = 'default' === $dsn->getHost() ? null : $dsn->getHost();
3031
$port = $dsn->getPort();
3132

3233
return (new SendgridApiTransport($key, $this->client, $this->dispatcher, $this->logger))->setHost($host)->setPort($port);
3334
}
3435

35-
if ('sendgrid+smtp' === $dsn->getScheme() || 'sendgrid+smtps' === $dsn->getScheme() || 'sendgrid' === $dsn->getScheme()) {
36+
if ('sendgrid+smtp' === $scheme || 'sendgrid+smtps' === $scheme || 'sendgrid' === $scheme) {
3637
return new SendgridSmtpTransport($key, $this->dispatcher, $this->logger);
3738
}
3839

src/Symfony/Component/Mailer/Bridge/Sendgrid/phpunit.xml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
</php>
1414

1515
<testsuites>
16-
<testsuite name="Symfony Sendgrid Mailer Test Suite">
16+
<testsuite name="Symfony Sendgrid Mailer Bridge Test Suite">
1717
<directory>./Tests/</directory>
1818
</testsuite>
1919
</testsuites>

src/Symfony/Component/Notifier/Bridge/FreeMobile/Tests/FreeMobileTransportFactoryTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
final class FreeMobileTransportFactoryTest extends TestCase
2121
{
22-
public function testCreateWithDsn(): void
22+
public function testCreateWithDsn()
2323
{
2424
$factory = $this->createFactory();
2525

@@ -30,7 +30,7 @@ public function testCreateWithDsn(): void
3030
$this->assertSame('freemobile://host.test?phone=0611223344', (string) $transport);
3131
}
3232

33-
public function testCreateWithNoPhoneThrowsMalformed(): void
33+
public function testCreateWithNoPhoneThrowsMalformed()
3434
{
3535
$factory = $this->createFactory();
3636

@@ -40,7 +40,7 @@ public function testCreateWithNoPhoneThrowsMalformed(): void
4040
$factory->create(Dsn::fromString($dsnIncomplete));
4141
}
4242

43-
public function testSupportsFreeMobileScheme(): void
43+
public function testSupportsFreeMobileScheme()
4444
{
4545
$factory = $this->createFactory();
4646

@@ -51,7 +51,7 @@ public function testSupportsFreeMobileScheme(): void
5151
$this->assertFalse($factory->supports(Dsn::fromString($dsnUnsupported)));
5252
}
5353

54-
public function testNonFreeMobileSchemeThrows(): void
54+
public function testNonFreeMobileSchemeThrows()
5555
{
5656
$factory = $this->createFactory();
5757

src/Symfony/Component/Notifier/Bridge/FreeMobile/Tests/FreeMobileTransportTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@
2020

2121
final class FreeMobileTransportTest extends TestCase
2222
{
23-
public function testToStringContainsProperties(): void
23+
public function testToStringContainsProperties()
2424
{
2525
$transport = $this->getTransport('0611223344');
2626

2727
$this->assertSame('freemobile://host.test?phone=0611223344', (string) $transport);
2828
}
2929

30-
public function testSupportsMessageInterface(): void
30+
public function testSupportsMessageInterface()
3131
{
3232
$transport = $this->getTransport('0611223344');
3333

@@ -42,7 +42,7 @@ public function testSupportsMessageInterface(): void
4242
$this->assertTrue($transport->supports(new SmsMessage('+33611223344', 'Hello!')));
4343
}
4444

45-
public function testSendNonSmsMessageThrowsException(): void
45+
public function testSendNonSmsMessageThrowsException()
4646
{
4747
$transport = $this->getTransport('0611223344');
4848

@@ -51,7 +51,7 @@ public function testSendNonSmsMessageThrowsException(): void
5151
$transport->send($this->createMock(MessageInterface::class));
5252
}
5353

54-
public function testSendSmsMessageButInvalidPhoneThrowsException(): void
54+
public function testSendSmsMessageButInvalidPhoneThrowsException()
5555
{
5656
$transport = $this->getTransport('0611223344');
5757

0 commit comments

Comments
 (0)