Skip to content

Commit

Permalink
ci: various fixes for linting (#81)
Browse files Browse the repository at this point in the history
* style: import dd-trace hook before use in _autoload.php

Signed-off-by: Tom Carrio <tom@carrio.dev>

* style: import before use in  otel _autoload.php

Signed-off-by: Tom Carrio <tom@carrio.dev>

* refactor: support logger in SplitProvider

Signed-off-by: Tom Carrio <tom@carrio.dev>

* test: return using stringable magic method FlagdProviderTest.php

Signed-off-by: Tom Carrio <tom@carrio.dev>

---------

Signed-off-by: Tom Carrio <tom@carrio.dev>
  • Loading branch information
tcarrio committed May 20, 2023
1 parent bb18c04 commit 3727b13
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
4 changes: 3 additions & 1 deletion hooks/DDTrace/src/_autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@

declare(strict_types=1);

use OpenFeature\Hooks\DDTrace\DDTraceHook;

// automatically registers the DDTraceHook for OpenFeature
OpenFeature\Hooks\DDTrace\DDTraceHook::register();
DDTraceHook::register();
4 changes: 3 additions & 1 deletion hooks/OpenTelemetry/src/_autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@

declare(strict_types=1);

use OpenFeature\Hooks\OpenTelemetry\OpenTelemetryHook;

// automatically registers the OTel hook for OpenFeature
OpenFeature\Hooks\OpenTelemetry\OpenTelemetryHook::register();
OpenTelemetryHook::register();
4 changes: 2 additions & 2 deletions providers/Flagd/tests/unit/FlagdProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function testCanInstantiateHttpWithConfigObject(): void
$mockStreamFactory->shouldReceive('createStream')->andReturn($mockStream);

$mockResponse = $this->mockery(ResponseInterface::class);
$mockResponse->shouldReceive('getBody')->andReturn("{
$mockResponse->shouldReceive('getBody->__toString')->andReturn("{
\"value\":\"{$expectedValue}\",
\"variant\":\"{$expectedVariant}\",
\"reason\":\"{$expectedReason}\"
Expand Down Expand Up @@ -111,7 +111,7 @@ public function testCanInstantiateHttpWithConfigArray(): void
$mockStreamFactory->shouldReceive('createStream')->andReturn($mockStream);

$mockResponse = $this->mockery(ResponseInterface::class);
$mockResponse->shouldReceive('getBody')->andReturn("{
$mockResponse->shouldReceive('getBody->__toString')->andReturn("{
\"value\":\"{$expectedValue}\",
\"variant\":\"{$expectedVariant}\",
\"reason\":\"{$expectedReason}\"
Expand Down
2 changes: 1 addition & 1 deletion providers/Split/src/SplitProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function __construct(?string $apiKey = '', array $options = [])
$this->client = $factory->client();
}

public function setLogger(LoggerInterface $logger)
public function setLogger(LoggerInterface $logger): void
{
Di::setLogger($logger);
}
Expand Down

0 comments on commit 3727b13

Please sign in to comment.