Skip to content

Commit

Permalink
Merge pull request #75 from flug/add/predis-dependency
Browse files Browse the repository at this point in the history
add client for predis
  • Loading branch information
clementtalleu authored Sep 2, 2024
2 parents f8961cc + 06ac1d2 commit 18e04e0
Show file tree
Hide file tree
Showing 41 changed files with 946 additions and 333 deletions.
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;

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

0 comments on commit 18e04e0

Please sign in to comment.