IndexCreator   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 3
Bugs 0 Features 0
Metric Value
wmc 1
eloc 4
c 3
b 0
f 0
dl 0
loc 17
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getStoredFields() 0 6 1
1
<?php declare(strict_types = 1);
2
3
/**
4
 * Created by PhpStorm.
5
 * User: gordon
6
 * Date: 24/3/2561
7
 * Time: 20:36 น.
8
 */
9
10
namespace Suilven\FreeTextSearch\Base;
11
12
use Suilven\FreeTextSearch\Indexes;
13
14
abstract class IndexCreator implements \Suilven\FreeTextSearch\Interfaces\IndexCreator
15
{
16
    /**
17
     * (Re)create an index of the given name, using the index configuration from YML
18
     *
19
     * @param string $indexName The name of the index
20
     */
21
    abstract public function createIndex(string $indexName): void;
22
23
24
    /** @return array<string> */
25
    protected function getStoredFields(string $indexName): array
26
    {
27
        $indexes = new Indexes();
28
        $index = $indexes->getIndex($indexName);
29
30
        return $index->getStoredFields();
31
    }
32
}
33