Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add client for predis #75

Merged
merged 14 commits into from
Sep 2, 2024
8 changes: 6 additions & 2 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,16 @@ jobs:
restore-keys: ${{ runner.os }}-composer-
- name: Install dependencies
run: composer install --prefer-dist
- name: Install Predis optional package
run: composer require predis/predis
- name: Test cs-fixer
run: vendor/bin/php-cs-fixer fix src --dry-run --diff --no-ansi
- name: Run phpstan
run: vendor/bin/phpstan analyse src --level=5
- name: Run tests
run: XDEBUG_MODE=coverage vendor/bin/phpunit
- name: Run tests with redis extension
run: XDEBUG_MODE=coverage REDIS_CLIENT=redis vendor/bin/phpunit
- name: Run tests with predis dependency
run: XDEBUG_MODE=coverage REDIS_CLIENT=predis vendor/bin/phpunit
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
Expand Down
5 changes: 4 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@
},
"require": {
"php": ">=8.2",
"ext-redis": "*",
"ext-json": "*"
},
"suggest": {
"ext-redis": "To use the php extension for Redis (phpredis)",
"predis/predis": "To use Predis as a Redis PHP client"
},
"require-dev": {
"phpunit/phpunit": "^11.0",
"friendsofphp/php-cs-fixer": "^3.57",
Expand Down
13 changes: 13 additions & 0 deletions src/Client/Helper/Converter.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?php

declare(strict_types=1);

namespace Talleu\RedisOm\Client\Helper;
clementtalleu marked this conversation as resolved.
Show resolved Hide resolved

final class Converter
{
public static function prefix(string $key): string
{
return str_replace('\\', '_', $key);
}
}
Loading