Passed
Pull Request — master (#129)
by Serhii
09:00
created

WriteAlias::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 1
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 1
b 0
f 0
1
<?php
2
3
namespace Matchish\ScoutElasticSearch\ElasticSearch;
4
5
/**
6
 * @internal
7
 */
8
final class WriteAlias implements Alias
9
{
10
    /**
11
     * @var Alias
12
     */
13
    private $origin;
14
15
    /**
16
     * @param Alias $origin
17
     */
18 14
    public function __construct(Alias $origin)
19
    {
20 14
        $this->origin = $origin;
21 14
    }
22
23 14
    public function name(): string
24
    {
25 14
        return $this->origin->name();
26
    }
27
28 14
    public function config(): array
29
    {
30 14
        return array_merge($this->origin->config(), ['is_write_index' => true]);
31
    }
32
}
33