Completed
Pull Request — master (#917)
by Dmitry
08:52
created

IndexConfig::getElasticSearchName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
/**
4
 * This file is part of the FOSElasticaBundle project.
5
 *
6
 * (c) Tim Nagel <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace FOS\ElasticaBundle\Configuration;
13
14
class IndexConfig extends IndexConfigAbstract
15
{
16
    /**
17
     * Indicates if the index should use an alias, allowing an index repopulation to occur
18
     * without overwriting the current index.
19
     *
20
     * @var bool
21
     */
22
    private $useAlias = false;
23
24
    /**
25
     * Constructor expects an array as generated by the Container Configuration builder.
26
     *
27
     * @param string       $name
28
     * @param TypeConfig[] $types
29
     * @param array        $config
30
     */
31 17 View Code Duplication
    public function __construct($name, array $types, array $config)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
32
    {
33 17
        $this->elasticSearchName = isset($config['elasticSearchName']) ? $config['elasticSearchName'] : $name;
34 17
        $this->name = $name;
35 17
        $this->settings = isset($config['settings']) ? $config['settings'] : array();
36 17
        $this->types = $types;
37 17
        $this->useAlias = isset($config['useAlias']) ? $config['useAlias'] : false;
38 17
    }
39
40
    /**
41
     * @return boolean
42
     */
43 6
    public function isUseAlias()
44
    {
45 6
        return $this->useAlias;
46
    }
47
}
48