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

[5.6] Redis Connection Contract #24142

Merged
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
35 changes: 35 additions & 0 deletions src/Illuminate/Contracts/Redis/Connections/Connection.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

namespace Illuminate\Contracts\Redis\Connections;

use Closure;

interface Connection
{
/**
* Subscribe to a set of given channels for messages.
*
* @param array|string $channels
* @param \Closure $callback
* @return void
*/
public function subscribe($channels, Closure $callback);

/**
* Subscribe to a set of given channels with wildcards.
*
* @param array|string $channels
* @param \Closure $callback
* @return void
*/
public function psubscribe($channels, Closure $callback);

/**
* Run a command against the Redis database.
*
* @param string $method
* @param array $parameters
* @return mixed
*/
public function command($method, array $parameters = []);
}
3 changes: 2 additions & 1 deletion src/Illuminate/Redis/Connections/PhpRedisConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@

use Redis;
use Closure;
use Illuminate\Contracts\Redis\Connections\Connection as ConnectionContract;

/**
* @mixin \Redis
*/
class PhpRedisConnection extends Connection
class PhpRedisConnection extends Connection implements ConnectionContract
{
/**
* Create a new PhpRedis connection.
Expand Down
3 changes: 2 additions & 1 deletion src/Illuminate/Redis/Connections/PredisConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
namespace Illuminate\Redis\Connections;

use Closure;
use Illuminate\Contracts\Redis\Connections\Connection as ConnectionContract;

/**
* @mixin \Predis\Client
*/
class PredisConnection extends Connection
class PredisConnection extends Connection implements ConnectionContract
{
/**
* Create a new Predis connection.
Expand Down