TypeConfig   A
last analyzed

Complexity

Total Complexity 8

Size/Duplication

Total Lines 62
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 8
lcom 1
cbo 0
dl 0
loc 62
ccs 0
cts 18
cp 0
rs 10
c 0
b 0
f 0

8 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A getDateDetection() 0 4 1
A getDynamicDateFormats() 0 4 1
A getAnalyzer() 0 4 1
A getMapping() 0 4 1
A getNumericDetection() 0 4 1
A getName() 0 4 1
A getDynamic() 0 4 1
1
<?php
2
3
/*
4
 * This file is part of the FOSElasticaBundle package.
5
 *
6
 * (c) FriendsOfSymfony <https://friendsofsymfony.github.com/>
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 TypeConfig
15
{
16
    /**
17
     * @var array
18
     */
19
    private $config;
20
21
    /**
22
     * @var array
23
     */
24
    private $mapping;
25
26
    /**
27
     * @var string
28
     */
29
    private $name;
30
31
    public function __construct(string $name, array $mapping, array $config = [])
32
    {
33
        $this->config = $config;
34
        $this->mapping = $mapping;
35
        $this->name = $name;
36
    }
37
38
    public function getDateDetection(): ?bool
39
    {
40
        return $this->config['date_detection'] ?? null;
41
    }
42
43
    public function getDynamicDateFormats(): ?array
44
    {
45
        return $this->config['dynamic_date_formats'] ?? null;
46
    }
47
48
    public function getAnalyzer(): ?string
49
    {
50
        return $this->config['analyzer'] ?? null;
51
    }
52
53
    public function getMapping(): array
54
    {
55
        return $this->mapping;
56
    }
57
58
    public function getNumericDetection(): ?bool
59
    {
60
        return $this->config['numeric_detection'] ?? null;
61
    }
62
63
    public function getName(): string
64
    {
65
        return $this->name;
66
    }
67
68
    /*
69
     * @return string|bool|null
70
     */
71
    public function getDynamic()
72
    {
73
        return $this->config['dynamic'] ?? null;
74
    }
75
}
76