| Total Complexity | 4 |
| Total Lines | 30 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 12 | final class RefreshIndex |
||
| 13 | { |
||
| 14 | /** |
||
| 15 | * @var Index |
||
| 16 | */ |
||
| 17 | private $index; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * RefreshIndex constructor. |
||
| 21 | * @param Index $index |
||
| 22 | */ |
||
| 23 | 16 | public function __construct(Index $index) |
|
| 24 | { |
||
| 25 | 16 | $this->index = $index; |
|
| 26 | 16 | } |
|
| 27 | |||
| 28 | 14 | public function handle(Client $elasticsearch): void |
|
| 29 | { |
||
| 30 | 14 | $params = new Refresh($this->index->name()); |
|
| 31 | 14 | $elasticsearch->indices()->refresh($params->toArray()); |
|
| 32 | 14 | } |
|
| 33 | |||
| 34 | 13 | public function estimate(): int |
|
| 37 | } |
||
| 38 | |||
| 39 | 13 | public function title(): string |
|
| 42 | } |
||
| 43 | } |
||
| 44 |