Completed
Pull Request — develop (#125)
by Sam
03:05 queued 01:11
created

AbstractMultiIndexCommand::handle()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 0
1
<?php
2
3
namespace Nord\Lumen\Elasticsearch\Console;
4
5
abstract class AbstractMultiIndexCommand extends IndexCommand
6
{
7
8
    /**
9
     * @return string[] the index names into which the command should index the data
10
     */
11
    abstract public function getIndices(): array;
12
13
    /**
14
     * @inheritDoc
15
     */
16
    public function getIndex()
17
    {
18
        throw new \RuntimeException('This method should be not be used with ' . __CLASS__);
19
    }
20
21
    /**
22
     * @inheritDoc
23
     */
24
    public function handle()
25
    {
26
        foreach ($this->getIndices() as $index) {
27
            $this->indexData($index);
28
        }
29
    }
30
}
31