forked from FriendsOfSymfony/FOSElasticaBundle
/
IndexConfigTrait.php
132 lines (114 loc) · 3.54 KB
/
IndexConfigTrait.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
<?php
/*
* This file is part of the FOSElasticaBundle package.
*
* (c) FriendsOfSymfony <https://friendsofsymfony.github.com/>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace FOS\ElasticaBundle\Configuration;
/**
* Index configuration trait class.
*
* @author Dmitry Balabka <dmitry.balabka@intexsys.lv>
*
* @phpstan-import-type TMapping from IndexConfigInterface
* @phpstan-import-type TSettings from IndexConfigInterface
* @phpstan-import-type TConfig from IndexConfigInterface
*/
trait IndexConfigTrait
{
/**
* The name of the index for ElasticSearch.
*
* @var string
*/
private $elasticSearchName;
/**
* The model of the index.
*
* @var string|null
*/
private $model;
/**
* The internal name of the index. May not be the same as the name used in ElasticSearch,
* especially if aliases are enabled.
*
* @var string
*/
private $name;
/**
* An array of settings sent to ElasticSearch when creating the index.
*
* @var array
*
* @phpstan-var TSettings
*
* @phpstan-ignore-next-line Ignored because of a bug in PHPStan (https://github.com/phpstan/phpstan/issues/5091)
*/
private $settings;
/**
* @var array
*
* @phpstan-var TConfig
*
* @phpstan-ignore-next-line Ignored because of a bug in PHPStan (https://github.com/phpstan/phpstan/issues/5091)
*/
private $config;
/**
* @var array
*
* @phpstan-var TMapping
*
* @phpstan-ignore-next-line Ignored because of a bug in PHPStan (https://github.com/phpstan/phpstan/issues/5091)
*/
private $mapping;
public function getElasticSearchName(): string
{
return $this->elasticSearchName;
}
public function getModel(): ?string
{
return $this->model;
}
public function getName(): string
{
return $this->name;
}
public function getSettings(): array
{
// @phpstan-ignore-next-line Ignored because of a bug in PHPStan (https://github.com/phpstan/phpstan/issues/5091)
return $this->settings;
}
public function getDateDetection(): ?bool
{
// @phpstan-ignore-next-line Ignored because of a bug in PHPStan (https://github.com/phpstan/phpstan/issues/5091)
return $this->config['date_detection'] ?? null;
}
public function getDynamicDateFormats(): ?array
{
// @phpstan-ignore-next-line Ignored because of a bug in PHPStan (https://github.com/phpstan/phpstan/issues/5091)
return $this->config['dynamic_date_formats'] ?? null;
}
public function getAnalyzer(): ?string
{
// @phpstan-ignore-next-line Ignored because of a bug in PHPStan (https://github.com/phpstan/phpstan/issues/5091)
return $this->config['analyzer'] ?? null;
}
public function getMapping(): array
{
// @phpstan-ignore-next-line Ignored because of a bug in PHPStan (https://github.com/phpstan/phpstan/issues/5091)
return $this->mapping;
}
public function getNumericDetection(): ?bool
{
// @phpstan-ignore-next-line Ignored because of a bug in PHPStan (https://github.com/phpstan/phpstan/issues/5091)
return $this->config['numeric_detection'] ?? null;
}
public function getDynamic()
{
// @phpstan-ignore-next-line Ignored because of a bug in PHPStan (https://github.com/phpstan/phpstan/issues/5091)
return $this->config['dynamic'] ?? null;
}
}