Skip to content

Commit 55e0511

Browse files
committed
Enhancement: Apply void_return fixer to tests
1 parent 432bcdf commit 55e0511

23 files changed

+123
-123
lines changed

tests/Functional/DiscoveredClientsTest.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
class DiscoveredClientsTest extends WebTestCase
1717
{
18-
public function testDiscoveredClient()
18+
public function testDiscoveredClient(): void
1919
{
2020
$container = $this->getContainer(false);
2121

@@ -26,7 +26,7 @@ public function testDiscoveredClient()
2626
$this->assertInstanceOf(HttpClient::class, $service);
2727
}
2828

29-
public function testDiscoveredAsyncClient()
29+
public function testDiscoveredAsyncClient(): void
3030
{
3131
$container = $this->getContainer(false);
3232

@@ -37,7 +37,7 @@ public function testDiscoveredAsyncClient()
3737
$this->assertInstanceOf(HttpAsyncClient::class, $service);
3838
}
3939

40-
public function testDiscoveredClientWithProfilingEnabled()
40+
public function testDiscoveredClientWithProfilingEnabled(): void
4141
{
4242
$container = $this->getContainer(true);
4343

@@ -49,7 +49,7 @@ public function testDiscoveredClientWithProfilingEnabled()
4949
$this->assertInstanceOf(HttpClient::class, NSA::getProperty($service, 'client'));
5050
}
5151

52-
public function testDiscoveredAsyncClientWithProfilingEnabled()
52+
public function testDiscoveredAsyncClientWithProfilingEnabled(): void
5353
{
5454
$container = $this->getContainer(true);
5555

@@ -64,7 +64,7 @@ public function testDiscoveredAsyncClientWithProfilingEnabled()
6464
/**
6565
* Test with httplug.discovery.client: "auto".
6666
*/
67-
public function testDiscovery()
67+
public function testDiscovery(): void
6868
{
6969
$container = $this->getContainer(true);
7070

@@ -86,7 +86,7 @@ public function testDiscovery()
8686
/**
8787
* Test with httplug.discovery.client: null.
8888
*/
89-
public function testDisabledDiscovery()
89+
public function testDisabledDiscovery(): void
9090
{
9191
$container = $this->getContainer(true, 'discovery_disabled');
9292

@@ -98,7 +98,7 @@ public function testDisabledDiscovery()
9898
/**
9999
* Test with httplug.discovery.client: "httplug.client.acme".
100100
*/
101-
public function testForcedDiscovery()
101+
public function testForcedDiscovery(): void
102102
{
103103
$container = $this->getContainer(true, 'discovery_forced');
104104

@@ -119,7 +119,7 @@ private function getContainer($debug, $environment = 'test')
119119
return static::$kernel->getContainer();
120120
}
121121

122-
protected function setUp()
122+
protected function setUp(): void
123123
{
124124
parent::setUp();
125125

tests/Functional/DiscoveryTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
*/
2121
final class DiscoveryTest extends AbstractExtensionTestCase
2222
{
23-
protected function setUp()
23+
protected function setUp(): void
2424
{
2525
parent::setUp();
2626

@@ -37,7 +37,7 @@ protected function getContainerExtensions()
3737
];
3838
}
3939

40-
public function testDiscoveryFallbacks()
40+
public function testDiscoveryFallbacks(): void
4141
{
4242
$this->load();
4343

@@ -48,7 +48,7 @@ public function testDiscoveryFallbacks()
4848
$this->assertContainerBuilderHasService('httplug.async_client.default', HttpAsyncClient::class);
4949
}
5050

51-
public function testDiscoveryPartialFallbacks()
51+
public function testDiscoveryPartialFallbacks(): void
5252
{
5353
$this->load();
5454
$this->setDefinition('httplug.client.default', new Definition(Client::class));
@@ -60,7 +60,7 @@ public function testDiscoveryPartialFallbacks()
6060
$this->assertContainerBuilderHasService('httplug.async_client.default', HttpAsyncClient::class);
6161
}
6262

63-
public function testNoDiscoveryFallbacks()
63+
public function testNoDiscoveryFallbacks(): void
6464
{
6565
$this->setDefinition('httplug.client.default', new Definition(HttpClient::class));
6666
$this->setDefinition('httplug.message_factory.default', new Definition(MessageFactory::class));
@@ -75,7 +75,7 @@ public function testNoDiscoveryFallbacks()
7575
$this->assertEquals([HttpClientDiscovery::class, 'find'], $clientDefinition->getFactory());
7676
}
7777

78-
public function testEnableAutowiring()
78+
public function testEnableAutowiring(): void
7979
{
8080
$this->load([
8181
'default_client_autowiring' => true,
@@ -87,7 +87,7 @@ public function testEnableAutowiring()
8787
$this->assertContainerBuilderHasAlias(HttpAsyncClient::class);
8888
}
8989

90-
public function testDisableAutowiring()
90+
public function testDisableAutowiring(): void
9191
{
9292
if (PHP_VERSION_ID <= 70000) {
9393
$this->markTestSkipped();

tests/Functional/Issue206.php

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

1414
class Issue206 extends WebTestCase
1515
{
16-
public function testCustomClientDoesNotCauseException()
16+
public function testCustomClientDoesNotCauseException(): void
1717
{
1818
static::bootKernel();
1919
$container = static::$kernel->getContainer();

tests/Functional/ProfilerTest.php

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

77
class ProfilerTest extends WebTestCase
88
{
9-
public function testShowProfiler()
9+
public function testShowProfiler(): void
1010
{
1111
$client = static::createClient();
1212

tests/Functional/ProfilingTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,14 @@ class ProfilingTest extends TestCase
3737
*/
3838
private $stopwatch;
3939

40-
public function setUp()
40+
public function setUp(): void
4141
{
4242
$this->collector = new Collector([]);
4343
$this->formatter = new Formatter(new FullHttpMessageFormatter(), new CurlCommandFormatter());
4444
$this->stopwatch = new Stopwatch();
4545
}
4646

47-
public function testProfilingWithCachePlugin()
47+
public function testProfilingWithCachePlugin(): void
4848
{
4949
$client = $this->createClient([
5050
new Plugin\CachePlugin(new ArrayAdapter(), StreamFactoryDiscovery::find(), [
@@ -64,7 +64,7 @@ public function testProfilingWithCachePlugin()
6464
$this->assertEquals('example.com', $stack->getRequestHost());
6565
}
6666

67-
public function testProfilingWhenPluginThrowException()
67+
public function testProfilingWhenPluginThrowException(): void
6868
{
6969
$client = $this->createClient([
7070
new ExceptionThrowerPlugin(),
@@ -83,7 +83,7 @@ public function testProfilingWhenPluginThrowException()
8383
}
8484
}
8585

86-
public function testProfiling()
86+
public function testProfiling(): void
8787
{
8888
$client = $this->createClient([
8989
new Plugin\AddHostPlugin(UriFactoryDiscovery::find()->createUri('https://example.com')),
@@ -122,7 +122,7 @@ class ExceptionThrowerPlugin implements Plugin
122122
{
123123
use Plugin\VersionBridgePlugin;
124124

125-
protected function doHandleRequest(RequestInterface $request, callable $next, callable $first)
125+
protected function doHandleRequest(RequestInterface $request, callable $next, callable $first): void
126126
{
127127
throw new \Exception();
128128
}

tests/Functional/ServiceInstantiationTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
class ServiceInstantiationTest extends WebTestCase
2626
{
27-
public function testHttpClient()
27+
public function testHttpClient(): void
2828
{
2929
static::bootKernel();
3030
$container = static::$kernel->getContainer();
@@ -33,7 +33,7 @@ public function testHttpClient()
3333
$this->assertInstanceOf(HttpClient::class, $client);
3434
}
3535

36-
public function testHttpClientNoDebug()
36+
public function testHttpClientNoDebug(): void
3737
{
3838
static::bootKernel(['debug' => false]);
3939
$container = static::$kernel->getContainer();
@@ -42,7 +42,7 @@ public function testHttpClientNoDebug()
4242
$this->assertInstanceOf(HttpClient::class, $client);
4343
}
4444

45-
public function testDebugToolbar()
45+
public function testDebugToolbar(): void
4646
{
4747
static::bootKernel(['debug' => true]);
4848
$container = static::$kernel->getContainer();
@@ -54,15 +54,15 @@ public function testDebugToolbar()
5454
$this->assertInstanceOf(Collector::class, $collector);
5555
}
5656

57-
public function testProfilingShouldNotChangeServiceReference()
57+
public function testProfilingShouldNotChangeServiceReference(): void
5858
{
5959
static::bootKernel(['debug' => true]);
6060
$container = static::$kernel->getContainer();
6161

6262
$this->assertInstanceof(RedirectPlugin::class, $container->get('app.http.plugin.custom'));
6363
}
6464

65-
public function testProfilingDecoration()
65+
public function testProfilingDecoration(): void
6666
{
6767
static::bootKernel(['debug' => true]);
6868
$container = static::$kernel->getContainer();
@@ -81,7 +81,7 @@ public function testProfilingDecoration()
8181
$this->assertInstanceOf(ProfilePlugin::class, $plugins[4]);
8282
}
8383

84-
public function testProfilingPsr18Decoration()
84+
public function testProfilingPsr18Decoration(): void
8585
{
8686
if (!interface_exists(ClientInterface::class)) {
8787
$this->markTestSkipped('PSR-18 is not installed');

tests/Resources/app/AppKernel.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function registerBundles()
3838
/**
3939
* {@inheritdoc}
4040
*/
41-
protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader)
41+
protected function configureContainer(ContainerBuilder $container, LoaderInterface $loader): void
4242
{
4343
$loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.yml');
4444
if ($this->isDebug()) {
@@ -49,7 +49,7 @@ protected function configureContainer(ContainerBuilder $container, LoaderInterfa
4949
/**
5050
* {@inheritdoc}
5151
*/
52-
protected function configureRoutes(RouteCollectionBuilder $routes)
52+
protected function configureRoutes(RouteCollectionBuilder $routes): void
5353
{
5454
$routes->import('@WebProfilerBundle/Resources/config/routing/wdt.xml', '/_wdt');
5555
$routes->import('@WebProfilerBundle/Resources/config/routing/profiler.xml', '/_profiler');
@@ -94,15 +94,15 @@ public function indexAction()
9494
return new Response();
9595
}
9696

97-
protected function build(ContainerBuilder $container)
97+
protected function build(ContainerBuilder $container): void
9898
{
9999
$container->addCompilerPass(new PublicServicesForFunctionalTestsPass());
100100
}
101101
}
102102

103103
class PublicServicesForFunctionalTestsPass implements CompilerPassInterface
104104
{
105-
public function process(ContainerBuilder $container)
105+
public function process(ContainerBuilder $container): void
106106
{
107107
$services = [
108108
'httplug.strategy',

tests/Unit/ClientFactory/BuzzFactoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*/
1313
class BuzzFactoryTest extends TestCase
1414
{
15-
public function testCreateClient()
15+
public function testCreateClient(): void
1616
{
1717
if (!class_exists(Client::class)) {
1818
$this->markTestSkipped('Buzz adapter is not installed');

tests/Unit/ClientFactory/CurlFactoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*/
1414
class CurlFactoryTest extends TestCase
1515
{
16-
public function testCreateClient()
16+
public function testCreateClient(): void
1717
{
1818
if (!class_exists(Client::class)) {
1919
$this->markTestSkipped('Curl client is not installed');

tests/Unit/ClientFactory/Guzzle6FactoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*/
1212
class Guzzle6FactoryTest extends TestCase
1313
{
14-
public function testCreateClient()
14+
public function testCreateClient(): void
1515
{
1616
if (!class_exists(Client::class)) {
1717
$this->markTestSkipped('Guzzle6 adapter is not installed');

tests/Unit/ClientFactory/MockFactoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
*/
1818
class MockFactoryTest extends TestCase
1919
{
20-
public function testCreateClient()
20+
public function testCreateClient(): void
2121
{
2222
$factory = new MockFactory();
2323
$client = $factory->createClient();

tests/Unit/ClientFactory/ReactFactoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*/
1313
class ReactFactoryTest extends TestCase
1414
{
15-
public function testCreateClient()
15+
public function testCreateClient(): void
1616
{
1717
if (!class_exists(Client::class)) {
1818
$this->markTestSkipped('React adapter is not installed');

tests/Unit/ClientFactory/SocketFactoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
*/
1313
class SocketFactoryTest extends TestCase
1414
{
15-
public function testCreateClient()
15+
public function testCreateClient(): void
1616
{
1717
if (!class_exists(Client::class)) {
1818
$this->markTestSkipped('Socket client is not installed');

tests/Unit/Collector/CollectorTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
class CollectorTest extends TestCase
1010
{
11-
public function testCollectClientNames()
11+
public function testCollectClientNames(): void
1212
{
1313
$collector = new Collector();
1414

@@ -19,7 +19,7 @@ public function testCollectClientNames()
1919
$this->assertEquals(['default', 'acme'], $collector->getClients());
2020
}
2121

22-
public function testActivateStack()
22+
public function testActivateStack(): void
2323
{
2424
$parent = new Stack('acme', 'GET / HTTP/1.1');
2525
$stack = new Stack('acme', 'GET / HTTP/1.1');
@@ -33,7 +33,7 @@ public function testActivateStack()
3333
$this->assertEquals($stack, $collector->getActiveStack());
3434
}
3535

36-
public function testDeactivateStack()
36+
public function testDeactivateStack(): void
3737
{
3838
$stack = new Stack('acme', 'GET / HTTP/1.1');
3939
$collector = new Collector();
@@ -45,7 +45,7 @@ public function testDeactivateStack()
4545
$this->assertNull($collector->getActiveStack());
4646
}
4747

48-
public function testDeactivateStackSetParentAsActiveStack()
48+
public function testDeactivateStackSetParentAsActiveStack(): void
4949
{
5050
$parent = new Stack('acme', 'GET / HTTP/1.1');
5151
$stack = new Stack('acme', 'GET / HTTP/1.1');
@@ -59,7 +59,7 @@ public function testDeactivateStackSetParentAsActiveStack()
5959
$this->assertEquals($parent, $collector->getActiveStack());
6060
}
6161

62-
public function testAddStack()
62+
public function testAddStack(): void
6363
{
6464
$stack = new Stack('acme', 'GET / HTTP/1.1');
6565
$collector = new Collector();
@@ -70,7 +70,7 @@ public function testAddStack()
7070
$this->assertEquals([$stack], $collector->getClientRootStacks('acme'));
7171
}
7272

73-
public function testResetAction()
73+
public function testResetAction(): void
7474
{
7575
$stack = new Stack('acme', 'GET / HTTP/1.1');
7676

0 commit comments

Comments
 (0)