Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit c4e879b

Browse files
committed
Add IBloomdClient interface, use it
1 parent 513fd4c commit c4e879b

File tree

3 files changed

+29
-2
lines changed

3 files changed

+29
-2
lines changed

src/PhpBloomd/BloomFilter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class BloomFilter
1414

1515
// CONSTRUCTOR - - - - - - - - - - - - - - - - - - - - -
1616

17-
public function __construct($name, BloomdClient $client)
17+
public function __construct($name, IBloomdClient $client)
1818
{
1919
$this->name = $name;
2020
$this->client = $client;

src/PhpBloomd/BloomdClient.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
namespace PhpBloomd;
44

5-
class BloomdClient
5+
require_once __DIR__ . "/IBloomdClient.php";
6+
7+
class BloomdClient implements IBloomdClient
68
{
79
// CONSTANTS - - - - - - - - - - - - - - - - - - - - -
810

src/PhpBloomd/IBloomdClient.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
3+
namespace PhpBloomd;
4+
5+
interface IBloomdClient
6+
{
7+
public function connect();
8+
public function disconnect();
9+
10+
public function filter($name);
11+
12+
public function createFilter($name, $capacity = null, $probability = null, $inMemory = null);
13+
public function closeFilter($name);
14+
public function clearFilter($name);
15+
public function dropFilter($name);
16+
public function flushFilter($name);
17+
public function listFilters($name = null);
18+
public function info($name);
19+
20+
public function check($filter, $value);
21+
public function set($filter, $value);
22+
23+
public function bulk($filter, array $items);
24+
public function multi($filter, array $items);
25+
}

0 commit comments

Comments
 (0)