Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ jobs:
- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: "none"
coverage: "xdebug"
extensions: redis
php-version: "${{ matrix.php-version }}"

- name: "Composer install"
Expand All @@ -55,4 +56,4 @@ jobs:
# Replace `linux` below with the appropriate OS
curl -Os https://uploader.codecov.io/latest/linux/codecov
chmod +x codecov
./codecov -t ${CODECOV_TOKEN}
./codecov -t ${CODECOV_TOKEN}
12 changes: 2 additions & 10 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,14 @@
<directory>tests/Unit</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory suffix=".php">src/</directory>
</whitelist>
</filter>
<coverage>
<include>
<directory suffix=".php">src</directory>
</include>
<report>
<clover outputFile="coverage/clover.xml" />
<html outputDirectory="test-coverage-report/" />
</report>
</coverage>

<logging>
<log type="coverage-clover" target="coverage/clover.xml"/>
</logging>

</phpunit>
</phpunit>
2 changes: 1 addition & 1 deletion src/Business/Redis/RedisManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class RedisManager implements RedisManagerInterface

public function __construct(
private readonly RedisFactoryInterface $redisFactory,
private readonly RedisPluginConfigurationInterface $redisPluginConfiguration
private readonly RedisPluginConfigurationInterface $redisPluginConfiguration,
) {
$this->redisCollection = [];
}
Expand Down
2 changes: 1 addition & 1 deletion src/Configuration/RedisClientConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function connectionType(): string
{
$connectionType = $this->get(self::CFG_CONNECTION_TYPE, self::CONNECTION_TYPE_DEFAULT);
if (!\in_array($connectionType, $this->getAvailableConnectionTypes(), true)) {
throw new InvalidConfigurationException(sprintf('Configuration key "%s" has invalid value. Redis: connection type %s is not available', $this->cfg(self::CFG_CONNECTION_TYPE), $connectionType));
throw new InvalidConfigurationException(\sprintf('Configuration key "%s" has invalid value. Redis: connection type %s is not available', $this->cfg(self::CFG_CONNECTION_TYPE), $connectionType));
}

return $connectionType;
Expand Down
6 changes: 3 additions & 3 deletions src/RedisPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ class RedisPlugin implements DependencyProviderInterface, ConfigurableInterface

public function provideDependencies(Container $container): void
{
$container->register(\Micro\Plugin\Redis\Facade\RedisFacadeInterface::class, function (): Facade\RedisFacadeInterface {
$container->register(Facade\RedisFacadeInterface::class, function (): Facade\RedisFacadeInterface {
return $this->createRedisFacade();
});

$container->register(RedisFacadeInterface::class, function (Container $container) { // Deprecation support
return $container->get(\Micro\Plugin\Redis\Facade\RedisFacadeInterface::class);
$container->register(RedisFacadeInterface::class, static function () use ($container): Facade\RedisFacadeInterface { // Deprecation support
return $container->get(Facade\RedisFacadeInterface::class);
});
}

Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Business/Redis/RedisManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

class RedisManagerTest extends TestCase
{
public function testGetClient()
public function testGetClient(): void
{
$factory = $this->createMock(RedisFactoryInterface::class);
$cfg = $this->createMock(RedisPluginConfigurationInterface::class);
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Facade/RedisFacadeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

class RedisFacadeTest extends TestCase
{
public function testGetClient()
public function testGetClient(): void
{
$manager = $this->createMock(RedisManagerInterface::class);
$manager->expects($this->once())->method('getClient')->with('test');
Expand Down
9 changes: 5 additions & 4 deletions tests/Unit/RedisPluginTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

class RedisPluginTest extends TestCase
{
public function testPlugin()
public function testPlugin(): void
{
$kernel = new AppKernel(
[],
Expand All @@ -31,12 +31,13 @@ public function testPlugin()

$kernel->run();

$this->expectException(\RedisException::class);
$this->expectExceptionMessage('Connection refused');
$facade = $kernel->container()->get(RedisFacadeInterface::class);
$facadeDeprecated = $kernel->container()->get(\Micro\Plugin\Redis\RedisFacadeInterface::class);

$this->assertEquals($facade, $facadeDeprecated);
$this->assertSame($facade, $facadeDeprecated);

$this->expectException(\RedisException::class);
$this->expectExceptionMessage('Connection refused');

$kernel->container()->get(RedisFacadeInterface::class)->getClient();
}
Expand Down
Loading