Passed
Push — feature/initial-implementation ( fae671...591f29 )
by Fike
02:37
created

NumberOfReplicasOption   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 3
dl 0
loc 18
c 0
b 0
f 0
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getConstraints() 0 3 1
A getFriendlyId() 0 3 1
A getId() 0 3 1
1
<?php
2
3
namespace AmaTeam\ElasticSearch\Indexing\Option;
4
5
use AmaTeam\ElasticSearch\Indexing\Option\Infrastructure\AbstractOption;
6
use Symfony\Component\Validator\Constraints\GreaterThanOrEqual;
7
use Symfony\Component\Validator\Constraints\Type;
8
9
class NumberOfReplicasOption extends AbstractOption
10
{
11
    const ID = 'number_of_replicas';
12
    const FRIENDLY_ID = 'numberOfReplicas';
13
14
    public function getId(): string
15
    {
16
        return self::ID;
17
    }
18
19
    public function getFriendlyId(): string
20
    {
21
        return self::FRIENDLY_ID;
22
    }
23
24
    public function getConstraints(): array
25
    {
26
        return [new Type('integer'), new GreaterThanOrEqual(0)];
27
    }
28
}
29