Passed
Push — dev ( 40f0b5...3a2e98 )
by Fike
02:50
created

ScaledFloatType   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getId() 0 3 1
A getFriendlyId() 0 3 1
A getParameters() 0 5 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace AmaTeam\ElasticSearch\Mapping\Type;
6
7
use AmaTeam\ElasticSearch\Mapping\Type\Infrastructure\AbstractNumericType;
8
use AmaTeam\ElasticSearch\Mapping\Type\Parameter\ScalingFactorParameter;
9
10
class ScaledFloatType extends AbstractNumericType
11
{
12
    const ID = 'scaled_float';
13
    const FRIENDLY_ID = 'scaledFloat';
14
15
    public function getId(): string
16
    {
17
        return self::ID;
18
    }
19
20
    public function getFriendlyId(): string
21
    {
22
        return self::FRIENDLY_ID;
23
    }
24
25
    /**
26
     * @inheritDoc
27
     */
28
    public function getParameters(): array
29
    {
30
        return array_merge(
31
            parent::getParameters(),
32
            [ScalingFactorParameter::getInstance()]
33
        );
34
    }
35
}
36