| Total Complexity | 2 |
| Total Lines | 36 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 8 | class Callback implements Deduplicator |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * The user defined callback function to generate the deduplication id. |
||
| 12 | * |
||
| 13 | * @var \Closure |
||
| 14 | */ |
||
| 15 | protected $callback; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * Create a new deduplicator instance. |
||
| 19 | * |
||
| 20 | * @param \Closure $callback |
||
| 21 | * |
||
| 22 | * @return void |
||
| 23 | */ |
||
| 24 | 27 | public function __construct(Closure $callback) |
|
| 27 | } |
||
| 28 | |||
| 29 | /** |
||
| 30 | * Generate a deduplication id using the defined callback function. |
||
| 31 | * |
||
| 32 | * This deduplicator can be used to allow a developer to quickly generate |
||
| 33 | * a custom deduplicator using a Closure, without having to implement |
||
| 34 | * a completely new deduplicator object. |
||
| 35 | * |
||
| 36 | * @param string $payload |
||
| 37 | * @param string $queue |
||
| 38 | * |
||
| 39 | * @return string |
||
| 40 | */ |
||
| 41 | 27 | public function generate($payload, $queue) |
|
| 46 |