Skip to content

Commit e9717d6

Browse files
committed
sonarqube suggestions
1 parent 1b20a54 commit e9717d6

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

src/Utils/NoOpTracerHook.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
class NoOpTracerHook implements TracerHook
66
{
7-
function on(int $method, int $event, ?array $args)
7+
public function on(int $method, int $event, ?array $args)
88
{
99
}
1010
}

src/Utils/TracerHook.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44

55
interface TracerHook
66
{
7-
function on(int $method, int $event, ?array $args);
7+
public function on(int $method, int $event, ?array $args);
88
}

tests/Link/Transfer/ConnectionFactoryTest.php

+4-1
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@
77
class ConnectionFactoryTest extends TestCase
88
{
99

10-
public function testHappyExchange(): void
10+
public function testProperTimeouts(): void
1111
{
1212
$c = new \ReflectionClass(ConnectionFactory::class);
1313
$m = $c->getMethod('formatTimeout');
14+
$m->setAccessible(true);
1415
$this->assertEquals(['sec' => 1, 'usec' => 0], $m->invoke(null, ['sec' =>1, 'usec' => 0]));
1516
$this->assertEquals(['sec' => 1, 'usec' => 0], $m->invoke(null, 0));
1617
$this->assertEquals(['sec' => 1, 'usec' => 0], $m->invoke(null, 1000));
@@ -23,6 +24,7 @@ public function testInvalidArrayTimeout(): void
2324
{
2425
$c = new \ReflectionClass(ConnectionFactory::class);
2526
$m = $c->getMethod('formatTimeout');
27+
$m->setAccessible(true);
2628
$this->expectExceptionMessage("timeout must either be an int (milliseconds) or an array with keys 'sec' & 'usec'");
2729
$m->invoke(null, []);
2830
}
@@ -31,6 +33,7 @@ public function testNonArrayNonIntTimeout(): void
3133
{
3234
$c = new \ReflectionClass(ConnectionFactory::class);
3335
$m = $c->getMethod('formatTimeout');
36+
$m->setAccessible(true);
3437
$this->expectExceptionMessage("timeout must either be an int (milliseconds) or an array with keys 'sec' & 'usec'");
3538
$m->invoke(null, 98.7);
3639
}

0 commit comments

Comments
 (0)