Passed
Branch master (8cb5b2)
by Christopher
04:33 queued 12s
created

Compiler   A

Complexity

Total Complexity 37

Size/Duplication

Total Lines 480
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 153
dl 0
loc 480
ccs 184
cts 184
cp 1
rs 9.44
c 0
b 0
f 0
wmc 37

32 Methods

Rating   Name   Duplication   Size   Complexity  
A compileBinary() 0 6 1
A compileRange() 0 8 1
A compileIp() 0 9 1
A compileFloat() 0 3 1
A compileBoolean() 0 9 1
A compileDoubleRange() 0 3 1
A compileKeyword() 0 17 1
A compileIntegerRange() 0 3 1
A compileShort() 0 3 1
A compileDateRange() 0 3 1
A compileCompletion() 0 9 1
A compileScaledFloat() 0 3 1
A compileFloatRange() 0 3 1
A compileLong() 0 3 1
A compileText() 0 21 1
A compileInteger() 0 3 1
A camelize() 0 3 1
A compileLongRange() 0 3 1
A compileGeoShape() 0 13 1
A compileIpRange() 0 3 1
A blueprintCallback() 0 12 2
A compileNested() 0 9 1
A compileHalfFloat() 0 3 1
A compileGeoPoint() 0 7 1
A compileFields() 0 14 5
A formatAttributes() 0 3 1
A compileByte() 0 3 1
A compileObject() 0 10 1
A compileTokenCount() 0 11 1
A compileNumeric() 0 11 1
A compileDouble() 0 3 1
A compileDate() 0 12 1
1
<?php
0 ignored issues
show
Coding Style introduced by
The PHP open tag does not have a corresponding PHP close tag
Loading history...
2
namespace Triadev\Leopard\Business\Mapping;
0 ignored issues
show
Coding Style introduced by
Missing file doc comment
Loading history...
3
4
use Illuminate\Support\Fluent;
5
6
class Compiler
0 ignored issues
show
Coding Style Documentation introduced by
Missing class doc comment
Loading history...
7
{
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration for class Compiler
Loading history...
8
    /**
9
     * Compile: text
10
     *
11
     * @param Fluent $fluent
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
Coding Style introduced by
Tag value indented incorrectly; expected 2 spaces but found 1
Loading history...
12
     * @return array
0 ignored issues
show
Coding Style introduced by
Tag cannot be grouped with parameter tags in a doc comment
Loading history...
13
     */
14 11
    public function compileText(Fluent $fluent) : array
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines before function; 0 found
Loading history...
15
    {
16 11
        return $this->formatAttributes([
1 ignored issue
show
Coding Style introduced by
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
17 11
            'type' => 'text',
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
18 11
            'analyzer' => $fluent->analyzer,
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
19 11
            'boost' => $fluent->boost,
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
20 11
            'eager_global_ordinals' => $fluent->eager_global_ordinals,
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
Coding Style introduced by
Variable "eager_global_ordinals" is not in valid camel caps format
Loading history...
21 11
            'fielddata' => $fluent->fielddata,
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
22 11
            'fielddata_frequency_filter' => $fluent->fielddata_frequency_filter,
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
Coding Style introduced by
Variable "fielddata_frequency_filter" is not in valid camel caps format
Loading history...
23 11
            'fields' => $fluent->fields,
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
24 11
            'index' => $fluent->index,
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
25 11
            'index_options' => $fluent->index_options,
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
Coding Style introduced by
Variable "index_options" is not in valid camel caps format
Loading history...
26 11
            'index_prefixes' => $fluent->index_prefixes,
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
Coding Style introduced by
Variable "index_prefixes" is not in valid camel caps format
Loading history...
27 11
            'index_phrases' => $fluent->index_phrases,
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
Coding Style introduced by
Variable "index_phrases" is not in valid camel caps format
Loading history...
28 11
            'norms' => $fluent->norms,
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
29 11
            'position_increment_gap' => $fluent->position_increment_gap,
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
Coding Style introduced by
Variable "position_increment_gap" is not in valid camel caps format
Loading history...
30 11
            'store' => $fluent->store,
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
31 11
            'search_analyzer' => $fluent->search_analyzer,
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
Coding Style introduced by
Variable "search_analyzer" is not in valid camel caps format
Loading history...
32 11
            'search_quote_analyzer' => $fluent->search_quote_analyzer,
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
Coding Style introduced by
Variable "search_quote_analyzer" is not in valid camel caps format
Loading history...
33 11
            'similarity' => $fluent->similarity,
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
34 11
            'term_vector' => $fluent->term_vector
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
Coding Style introduced by
Variable "term_vector" is not in valid camel caps format
Loading history...
35
        ]);
0 ignored issues
show
Coding Style introduced by
The closing parenthesis does not seem to be aligned correctly; expected 39 space(s), but found 8.
Loading history...
Coding Style introduced by
For multi-line function calls, the closing parenthesis should be on a new line.

If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
); // Closing parenthesis on a new line.
Loading history...
36
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end compileText()
Loading history...
37
    
38
    /**
39
     * Compile: keyword
40
     *
41
     * @param Fluent $fluent
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
Coding Style introduced by
Tag value indented incorrectly; expected 2 spaces but found 1
Loading history...
42
     * @return array
0 ignored issues
show
Coding Style introduced by
Tag cannot be grouped with parameter tags in a doc comment
Loading history...
43
     */
44 12
    public function compileKeyword(Fluent $fluent) : array
45
    {
46 12
        return $this->formatAttributes([
1 ignored issue
show
Coding Style introduced by
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
47 12
            'type' => 'keyword',
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
48 12
            'boost' => $fluent->boost,
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
49 12
            'doc_values' => $fluent->doc_values,
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
Coding Style introduced by
Variable "doc_values" is not in valid camel caps format
Loading history...
50 12
            'eager_global_ordinals' => $fluent->eager_global_ordinals,
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
Coding Style introduced by
Variable "eager_global_ordinals" is not in valid camel caps format
Loading history...
51 12
            'fields' => $fluent->fields,
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
52 12
            'ignore_above' => $fluent->ignore_above,
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
Coding Style introduced by
Variable "ignore_above" is not in valid camel caps format
Loading history...
53 12
            'index' => $fluent->index,
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
54 12
            'index_options' => $fluent->index_options,
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
Coding Style introduced by
Variable "index_options" is not in valid camel caps format
Loading history...
55 12
            'norms' => $fluent->norms,
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
56 12
            'null_value' => $fluent->null_value,
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
Coding Style introduced by
Variable "null_value" is not in valid camel caps format
Loading history...
57 12
            'store' => $fluent->store,
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
58 12
            'similarity' => $fluent->similarity,
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
59 12
            'normalizer' => $fluent->normalizer,
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
60 12
            'split_queries_on_whitespace' => $fluent->split_queries_on_whitespace
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
Coding Style introduced by
Variable "split_queries_on_whitespace" is not in valid camel caps format
Loading history...
61
        ]);
0 ignored issues
show
Coding Style introduced by
The closing parenthesis does not seem to be aligned correctly; expected 39 space(s), but found 8.
Loading history...
Coding Style introduced by
For multi-line function calls, the closing parenthesis should be on a new line.

If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
); // Closing parenthesis on a new line.
Loading history...
62
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end compileKeyword()
Loading history...
63
    
64
    /**
65
     * Compile: long
66
     *
67
     * @param Fluent $fluent
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
Coding Style introduced by
Tag value indented incorrectly; expected 2 spaces but found 1
Loading history...
68
     * @return array
0 ignored issues
show
Coding Style introduced by
Tag cannot be grouped with parameter tags in a doc comment
Loading history...
69
     */
70 2
    public function compileLong(Fluent $fluent) : array
71
    {
72 2
        return $this->compileNumeric($fluent);
73
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end compileLong()
Loading history...
74
    
75
    /**
76
     * Compile: integer
77
     *
78
     * @param Fluent $fluent
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
Coding Style introduced by
Tag value indented incorrectly; expected 2 spaces but found 1
Loading history...
79
     * @return array
0 ignored issues
show
Coding Style introduced by
Tag cannot be grouped with parameter tags in a doc comment
Loading history...
80
     */
81 10
    public function compileInteger(Fluent $fluent) : array
82
    {
83 10
        return $this->compileNumeric($fluent);
84
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end compileInteger()
Loading history...
85
    
86
    /**
87
     * Compile: short
88
     *
89
     * @param Fluent $fluent
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
Coding Style introduced by
Tag value indented incorrectly; expected 2 spaces but found 1
Loading history...
90
     * @return array
0 ignored issues
show
Coding Style introduced by
Tag cannot be grouped with parameter tags in a doc comment
Loading history...
91
     */
92 2
    public function compileShort(Fluent $fluent) : array
93
    {
94 2
        return $this->compileNumeric($fluent);
95
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end compileShort()
Loading history...
96
    
97
    /**
98
     * Compile: byte
99
     *
100
     * @param Fluent $fluent
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
Coding Style introduced by
Tag value indented incorrectly; expected 2 spaces but found 1
Loading history...
101
     * @return array
0 ignored issues
show
Coding Style introduced by
Tag cannot be grouped with parameter tags in a doc comment
Loading history...
102
     */
103 2
    public function compileByte(Fluent $fluent) : array
104
    {
105 2
        return $this->compileNumeric($fluent);
106
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end compileByte()
Loading history...
107
    
108
    /**
109
     * Compile: double
110
     *
111
     * @param Fluent $fluent
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
Coding Style introduced by
Tag value indented incorrectly; expected 2 spaces but found 1
Loading history...
112
     * @return array
0 ignored issues
show
Coding Style introduced by
Tag cannot be grouped with parameter tags in a doc comment
Loading history...
113
     */
114 2
    public function compileDouble(Fluent $fluent) : array
115
    {
116 2
        return $this->compileNumeric($fluent);
117
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end compileDouble()
Loading history...
118
    
119
    /**
120
     * Compile: float
121
     *
122
     * @param Fluent $fluent
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
Coding Style introduced by
Tag value indented incorrectly; expected 2 spaces but found 1
Loading history...
123
     * @return array
0 ignored issues
show
Coding Style introduced by
Tag cannot be grouped with parameter tags in a doc comment
Loading history...
124
     */
125 2
    public function compileFloat(Fluent $fluent) : array
126
    {
127 2
        return $this->compileNumeric($fluent);
128
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end compileFloat()
Loading history...
129
    
130
    /**
131
     * Compile: half float
132
     *
133
     * @param Fluent $fluent
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
Coding Style introduced by
Tag value indented incorrectly; expected 2 spaces but found 1
Loading history...
134
     * @return array
0 ignored issues
show
Coding Style introduced by
Tag cannot be grouped with parameter tags in a doc comment
Loading history...
135
     */
136 2
    public function compileHalfFloat(Fluent $fluent) : array
137
    {
138 2
        return $this->compileNumeric($fluent);
139
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end compileHalfFloat()
Loading history...
140
    
141
    /**
142
     * Compile: scaled float
143
     *
144
     * @param Fluent $fluent
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
Coding Style introduced by
Tag value indented incorrectly; expected 2 spaces but found 1
Loading history...
145
     * @return array
0 ignored issues
show
Coding Style introduced by
Tag cannot be grouped with parameter tags in a doc comment
Loading history...
146
     */
147 2
    public function compileScaledFloat(Fluent $fluent) : array
148
    {
149 2
        return $this->compileNumeric($fluent);
150
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end compileScaledFloat()
Loading history...
151
    
152
    /**
153
     * Compile: numeric
154
     *
155
     * @param Fluent $fluent
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
Coding Style introduced by
Tag value indented incorrectly; expected 2 spaces but found 1
Loading history...
156
     * @return array
0 ignored issues
show
Coding Style introduced by
Tag cannot be grouped with parameter tags in a doc comment
Loading history...
157
     */
158 17
    public function compileNumeric(Fluent $fluent) : array
159
    {
160 17
        return $this->formatAttributes([
1 ignored issue
show
Coding Style introduced by
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
161 17
            'type' => $fluent->type,
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
162 17
            'coerce' => $fluent->coerce,
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
163 17
            'boost' => $fluent->boost,
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
164 17
            'doc_values' => $fluent->doc_values,
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
Coding Style introduced by
Variable "doc_values" is not in valid camel caps format
Loading history...
165 17
            'ignore_malformed' => $fluent->ignore_malformed,
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
Coding Style introduced by
Variable "ignore_malformed" is not in valid camel caps format
Loading history...
166 17
            'index' => $fluent->index,
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
167 17
            'null_value' => $fluent->null_value,
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
Coding Style introduced by
Variable "null_value" is not in valid camel caps format
Loading history...
168 17
            'store' => $fluent->store
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
169
        ]);
0 ignored issues
show
Coding Style introduced by
The closing parenthesis does not seem to be aligned correctly; expected 39 space(s), but found 8.
Loading history...
Coding Style introduced by
For multi-line function calls, the closing parenthesis should be on a new line.

If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
); // Closing parenthesis on a new line.
Loading history...
170
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end compileNumeric()
Loading history...
171
    
172
    /**
173
     * Compile: date
174
     *
175
     * @param Fluent $fluent
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
Coding Style introduced by
Tag value indented incorrectly; expected 2 spaces but found 1
Loading history...
176
     * @return array
0 ignored issues
show
Coding Style introduced by
Tag cannot be grouped with parameter tags in a doc comment
Loading history...
177
     */
178 2
    public function compileDate(Fluent $fluent) : array
179
    {
180 2
        return $this->formatAttributes([
1 ignored issue
show
Coding Style introduced by
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
181 2
            'type' => 'date',
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
182 2
            'boost' => $fluent->boost,
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
183 2
            'doc_values' => $fluent->doc_values,
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
Coding Style introduced by
Variable "doc_values" is not in valid camel caps format
Loading history...
184 2
            'format' => $fluent->format,
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
185 2
            'locale' => $fluent->locale,
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
186 2
            'ignore_malformed' => $fluent->ignore_malformed,
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
Coding Style introduced by
Variable "ignore_malformed" is not in valid camel caps format
Loading history...
187 2
            'index' => $fluent->index,
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
188 2
            'null_value' => $fluent->null_value,
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
Coding Style introduced by
Variable "null_value" is not in valid camel caps format
Loading history...
189 2
            'store' => $fluent->store
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
190
        ]);
0 ignored issues
show
Coding Style introduced by
The closing parenthesis does not seem to be aligned correctly; expected 39 space(s), but found 8.
Loading history...
Coding Style introduced by
For multi-line function calls, the closing parenthesis should be on a new line.

If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
); // Closing parenthesis on a new line.
Loading history...
191
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end compileDate()
Loading history...
192
    
193
    /**
194
     * Compile: boolean
195
     *
196
     * @param Fluent $fluent
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
Coding Style introduced by
Tag value indented incorrectly; expected 2 spaces but found 1
Loading history...
197
     * @return array
0 ignored issues
show
Coding Style introduced by
Tag cannot be grouped with parameter tags in a doc comment
Loading history...
198
     */
199 2
    public function compileBoolean(Fluent $fluent) : array
200
    {
201 2
        return $this->formatAttributes([
1 ignored issue
show
Coding Style introduced by
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
202 2
            'type' => 'boolean',
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
203 2
            'boost' => $fluent->boost,
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
204 2
            'doc_values' => $fluent->doc_values,
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
Coding Style introduced by
Variable "doc_values" is not in valid camel caps format
Loading history...
205 2
            'index' => $fluent->index,
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
206 2
            'null_value' => $fluent->null_value,
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
Coding Style introduced by
Variable "null_value" is not in valid camel caps format
Loading history...
207 2
            'store' => $fluent->store
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
208
        ]);
0 ignored issues
show
Coding Style introduced by
The closing parenthesis does not seem to be aligned correctly; expected 39 space(s), but found 8.
Loading history...
Coding Style introduced by
For multi-line function calls, the closing parenthesis should be on a new line.

If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
); // Closing parenthesis on a new line.
Loading history...
209
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end compileBoolean()
Loading history...
210
    
211
    /**
212
     * Compile: binary
213
     *
214
     * @param Fluent $fluent
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
Coding Style introduced by
Tag value indented incorrectly; expected 2 spaces but found 1
Loading history...
215
     * @return array
0 ignored issues
show
Coding Style introduced by
Tag cannot be grouped with parameter tags in a doc comment
Loading history...
216
     */
217 2
    public function compileBinary(Fluent $fluent) : array
218
    {
219 2
        return $this->formatAttributes([
1 ignored issue
show
Coding Style introduced by
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
220 2
            'type' => 'binary',
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
221 2
            'doc_values' => $fluent->doc_values,
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
Coding Style introduced by
Variable "doc_values" is not in valid camel caps format
Loading history...
222 2
            'store' => $fluent->store
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
223
        ]);
0 ignored issues
show
Coding Style introduced by
The closing parenthesis does not seem to be aligned correctly; expected 39 space(s), but found 8.
Loading history...
Coding Style introduced by
For multi-line function calls, the closing parenthesis should be on a new line.

If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
); // Closing parenthesis on a new line.
Loading history...
224
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end compileBinary()
Loading history...
225
    
226
    /**
227
     * Compile: integer range
228
     *
229
     * @param Fluent $fluent
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
Coding Style introduced by
Tag value indented incorrectly; expected 2 spaces but found 1
Loading history...
230
     * @return array
0 ignored issues
show
Coding Style introduced by
Tag cannot be grouped with parameter tags in a doc comment
Loading history...
231
     */
232 4
    public function compileIntegerRange(Fluent $fluent) : array
233
    {
234 4
        return $this->compileRange($fluent);
235
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end compileIntegerRange()
Loading history...
236
    
237
    /**
238
     * Compile: float range
239
     *
240
     * @param Fluent $fluent
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
Coding Style introduced by
Tag value indented incorrectly; expected 2 spaces but found 1
Loading history...
241
     * @return array
0 ignored issues
show
Coding Style introduced by
Tag cannot be grouped with parameter tags in a doc comment
Loading history...
242
     */
243 2
    public function compileFloatRange(Fluent $fluent) : array
244
    {
245 2
        return $this->compileRange($fluent);
246
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end compileFloatRange()
Loading history...
247
    
248
    /**
249
     * Compile: long range
250
     *
251
     * @param Fluent $fluent
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
Coding Style introduced by
Tag value indented incorrectly; expected 2 spaces but found 1
Loading history...
252
     * @return array
0 ignored issues
show
Coding Style introduced by
Tag cannot be grouped with parameter tags in a doc comment
Loading history...
253
     */
254 2
    public function compileLongRange(Fluent $fluent) : array
255
    {
256 2
        return $this->compileRange($fluent);
257
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end compileLongRange()
Loading history...
258
    
259
    /**
260
     * Compile: double range
261
     *
262
     * @param Fluent $fluent
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
Coding Style introduced by
Tag value indented incorrectly; expected 2 spaces but found 1
Loading history...
263
     * @return array
0 ignored issues
show
Coding Style introduced by
Tag cannot be grouped with parameter tags in a doc comment
Loading history...
264
     */
265 2
    public function compileDoubleRange(Fluent $fluent) : array
266
    {
267 2
        return $this->compileRange($fluent);
268
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end compileDoubleRange()
Loading history...
269
    
270
    /**
271
     * Compile: date range
272
     *
273
     * @param Fluent $fluent
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
Coding Style introduced by
Tag value indented incorrectly; expected 2 spaces but found 1
Loading history...
274
     * @return array
0 ignored issues
show
Coding Style introduced by
Tag cannot be grouped with parameter tags in a doc comment
Loading history...
275
     */
276 1
    public function compileDateRange(Fluent $fluent) : array
277
    {
278 1
        return $this->compileRange($fluent);
279
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end compileDateRange()
Loading history...
280
    
281
    /**
282
     * Compile: ip range
283
     *
284
     * @param Fluent $fluent
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
Coding Style introduced by
Tag value indented incorrectly; expected 2 spaces but found 1
Loading history...
285
     * @return array
0 ignored issues
show
Coding Style introduced by
Tag cannot be grouped with parameter tags in a doc comment
Loading history...
286
     */
287 1
    public function compileIpRange(Fluent $fluent) : array
288
    {
289 1
        return $this->compileRange($fluent);
290
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end compileIpRange()
Loading history...
291
    
292
    /**
293
     * Compile: range
294
     *
295
     * @param Fluent $fluent
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
Coding Style introduced by
Tag value indented incorrectly; expected 2 spaces but found 1
Loading history...
296
     * @return array
0 ignored issues
show
Coding Style introduced by
Tag cannot be grouped with parameter tags in a doc comment
Loading history...
297
     */
298 7
    public function compileRange(Fluent $fluent) : array
299
    {
300 7
        return $this->formatAttributes([
1 ignored issue
show
Coding Style introduced by
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
301 7
            'type' => $fluent->type,
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
302 7
            'coerce' => $fluent->coerce,
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
303 7
            'boost' => $fluent->boost,
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
304 7
            'index' => $fluent->index,
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
305 7
            'store' => $fluent->store
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
306
        ]);
0 ignored issues
show
Coding Style introduced by
The closing parenthesis does not seem to be aligned correctly; expected 39 space(s), but found 8.
Loading history...
Coding Style introduced by
For multi-line function calls, the closing parenthesis should be on a new line.

If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
); // Closing parenthesis on a new line.
Loading history...
307
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end compileRange()
Loading history...
308
    
309
    /**
310
     * Compile: nested
311
     *
312
     * @param Fluent $fluent
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
Coding Style introduced by
Tag value indented incorrectly; expected 2 spaces but found 1
Loading history...
313
     * @return array
0 ignored issues
show
Coding Style introduced by
Tag cannot be grouped with parameter tags in a doc comment
Loading history...
314
     */
315 2
    public function compileNested(Fluent $fluent) : array
316
    {
317 2
        return $this->formatAttributes([
1 ignored issue
show
Coding Style introduced by
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
318 2
            'type' => 'nested',
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
319 2
            'dynamic' => $fluent->dynamic,
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
320 2
            'properties' => $this->compileFields(
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
321 2
                $this->blueprintCallback(
322 2
                    $fluent
323 2
                )->getFields()
324
            )
325
        ]);
0 ignored issues
show
Coding Style introduced by
The closing parenthesis does not seem to be aligned correctly; expected 39 space(s), but found 8.
Loading history...
Coding Style introduced by
For multi-line function calls, the closing parenthesis should be on a new line.

If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
); // Closing parenthesis on a new line.
Loading history...
326
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end compileNested()
Loading history...
327
    
328
    /**
329
     * Compile: object
330
     *
331
     * @param Fluent $fluent
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
Coding Style introduced by
Tag value indented incorrectly; expected 2 spaces but found 1
Loading history...
332
     * @return array
0 ignored issues
show
Coding Style introduced by
Tag cannot be grouped with parameter tags in a doc comment
Loading history...
333
     */
334 2
    public function compileObject(Fluent $fluent) : array
335
    {
336 2
        return $this->formatAttributes([
1 ignored issue
show
Coding Style introduced by
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
337 2
            'type' => 'nested',
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
338 2
            'dynamic' => $fluent->dynamic,
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
339 2
            'enabled' => $fluent->enabled,
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
340 2
            'properties' => $this->compileFields(
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
341 2
                $this->blueprintCallback(
342 2
                    $fluent
343 2
                )->getFields()
344
            )
345
        ]);
0 ignored issues
show
Coding Style introduced by
The closing parenthesis does not seem to be aligned correctly; expected 39 space(s), but found 8.
Loading history...
Coding Style introduced by
For multi-line function calls, the closing parenthesis should be on a new line.

If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
); // Closing parenthesis on a new line.
Loading history...
346
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end compileObject()
Loading history...
347
    
348 3
    private function blueprintCallback(Fluent $fluent) : Blueprint
0 ignored issues
show
Coding Style introduced by
Private method name "Compiler::blueprintCallback" must be prefixed with an underscore
Loading history...
Coding Style introduced by
Missing function doc comment
Loading history...
349
    {
350 3
        $blueprint = new Blueprint();
351
    
352
        /** @var \Closure $callback */
0 ignored issues
show
Coding Style introduced by
Inline doc block comments are not allowed; use "/* Comment */" or "// Comment" instead
Loading history...
Coding Style introduced by
Block comments must be started with /*
Loading history...
Coding Style introduced by
The open comment tag must be the only content on the line
Loading history...
Coding Style introduced by
Missing short description in doc comment
Loading history...
Coding Style introduced by
The close comment tag must be the only content on the line
Loading history...
353 3
        $callback = $fluent->callback;
354
    
355 3
        if (is_callable($callback)) {
356 3
            $callback($blueprint);
357
        }
358
    
359 3
        return $blueprint;
360
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end blueprintCallback()
Loading history...
361
    
362
    /**
363
     * Compile: geo point
364
     *
365
     * @param Fluent $fluent
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
Coding Style introduced by
Tag value indented incorrectly; expected 2 spaces but found 1
Loading history...
366
     * @return array
0 ignored issues
show
Coding Style introduced by
Tag cannot be grouped with parameter tags in a doc comment
Loading history...
367
     */
368 2
    public function compileGeoPoint(Fluent $fluent) : array
369
    {
370 2
        return $this->formatAttributes([
1 ignored issue
show
Coding Style introduced by
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
371 2
            'type' => 'geo_point',
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
372 2
            'ignore_malformed' => $fluent->ignore_malformed,
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
Coding Style introduced by
Variable "ignore_malformed" is not in valid camel caps format
Loading history...
373 2
            'ignore_z_value' => $fluent->ignore_z_value,
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
Coding Style introduced by
Variable "ignore_z_value" is not in valid camel caps format
Loading history...
374 2
            'null_value' => $fluent->null_value
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
Coding Style introduced by
Variable "null_value" is not in valid camel caps format
Loading history...
375
        ]);
0 ignored issues
show
Coding Style introduced by
The closing parenthesis does not seem to be aligned correctly; expected 39 space(s), but found 8.
Loading history...
Coding Style introduced by
For multi-line function calls, the closing parenthesis should be on a new line.

If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
); // Closing parenthesis on a new line.
Loading history...
376
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end compileGeoPoint()
Loading history...
377
    
378
    /**
379
     * Compile: geo shape
380
     *
381
     * @param Fluent $fluent
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
Coding Style introduced by
Tag value indented incorrectly; expected 2 spaces but found 1
Loading history...
382
     * @return array
0 ignored issues
show
Coding Style introduced by
Tag cannot be grouped with parameter tags in a doc comment
Loading history...
383
     */
384 2
    public function compileGeoShape(Fluent $fluent) : array
385
    {
386 2
        return $this->formatAttributes([
1 ignored issue
show
Coding Style introduced by
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
387 2
            'type' => 'geo_shape',
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
388 2
            'tree' => $fluent->tree,
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
389 2
            'precision' => $fluent->precision,
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
390 2
            'tree_levels' => $fluent->tree_levels,
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
Coding Style introduced by
Variable "tree_levels" is not in valid camel caps format
Loading history...
391 2
            'strategy' => $fluent->strategy,
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
392 2
            'distance_error_pct' => $fluent->distance_error_pct,
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
Coding Style introduced by
Variable "distance_error_pct" is not in valid camel caps format
Loading history...
393 2
            'orientation' => $fluent->orientation,
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
394 2
            'points_only' => $fluent->points_only,
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
Coding Style introduced by
Variable "points_only" is not in valid camel caps format
Loading history...
395 2
            'ignore_malformed' => $fluent->ignore_malformed,
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
Coding Style introduced by
Variable "ignore_malformed" is not in valid camel caps format
Loading history...
396 2
            'ignore_z_value' => $fluent->ignore_z_value
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
Coding Style introduced by
Variable "ignore_z_value" is not in valid camel caps format
Loading history...
397
        ]);
0 ignored issues
show
Coding Style introduced by
The closing parenthesis does not seem to be aligned correctly; expected 39 space(s), but found 8.
Loading history...
Coding Style introduced by
For multi-line function calls, the closing parenthesis should be on a new line.

If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
); // Closing parenthesis on a new line.
Loading history...
398
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end compileGeoShape()
Loading history...
399
    
400
    /**
401
     * Compile: ip
402
     *
403
     * @param Fluent $fluent
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
Coding Style introduced by
Tag value indented incorrectly; expected 2 spaces but found 1
Loading history...
404
     * @return array
0 ignored issues
show
Coding Style introduced by
Tag cannot be grouped with parameter tags in a doc comment
Loading history...
405
     */
406 2
    public function compileIp(Fluent $fluent) : array
407
    {
408 2
        return $this->formatAttributes([
1 ignored issue
show
Coding Style introduced by
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
409 2
            'type' => 'ip',
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
410 2
            'boost' => $fluent->boost,
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
411 2
            'doc_values' => $fluent->doc_values,
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
Coding Style introduced by
Variable "doc_values" is not in valid camel caps format
Loading history...
412 2
            'index' => $fluent->index,
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
413 2
            'null_value' => $fluent->null_value,
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
Coding Style introduced by
Variable "null_value" is not in valid camel caps format
Loading history...
414 2
            'store' => $fluent->store
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
415
        ]);
0 ignored issues
show
Coding Style introduced by
The closing parenthesis does not seem to be aligned correctly; expected 39 space(s), but found 8.
Loading history...
Coding Style introduced by
For multi-line function calls, the closing parenthesis should be on a new line.

If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
); // Closing parenthesis on a new line.
Loading history...
416
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end compileIp()
Loading history...
417
    
418
    /**
419
     * Compile: completion
420
     *
421
     * @param Fluent $fluent
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
Coding Style introduced by
Tag value indented incorrectly; expected 2 spaces but found 1
Loading history...
422
     * @return array
0 ignored issues
show
Coding Style introduced by
Tag cannot be grouped with parameter tags in a doc comment
Loading history...
423
     */
424 2
    public function compileCompletion(Fluent $fluent) : array
425
    {
426 2
        return $this->formatAttributes([
1 ignored issue
show
Coding Style introduced by
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
427 2
            'type' => 'completion',
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
428 2
            'analyzer' => $fluent->analyzer,
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
429 2
            'search_analyzer' => $fluent->search_analyzer,
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
Coding Style introduced by
Variable "search_analyzer" is not in valid camel caps format
Loading history...
430 2
            'preserve_separators' => $fluent->preserve_separators,
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
Coding Style introduced by
Variable "preserve_separators" is not in valid camel caps format
Loading history...
431 2
            'preserve_position_increments' => $fluent->preserve_position_increments,
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
Coding Style introduced by
Variable "preserve_position_increments" is not in valid camel caps format
Loading history...
432 2
            'max_input_length' => $fluent->max_input_length
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
Coding Style introduced by
Variable "max_input_length" is not in valid camel caps format
Loading history...
433
        ]);
0 ignored issues
show
Coding Style introduced by
The closing parenthesis does not seem to be aligned correctly; expected 39 space(s), but found 8.
Loading history...
Coding Style introduced by
For multi-line function calls, the closing parenthesis should be on a new line.

If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
); // Closing parenthesis on a new line.
Loading history...
434
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end compileCompletion()
Loading history...
435
    
436
    /**
437
     * Compile: token count
438
     *
439
     * @param Fluent $fluent
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
Coding Style introduced by
Tag value indented incorrectly; expected 2 spaces but found 1
Loading history...
440
     * @return array
0 ignored issues
show
Coding Style introduced by
Tag cannot be grouped with parameter tags in a doc comment
Loading history...
441
     */
442 2
    public function compileTokenCount(Fluent $fluent) : array
443
    {
444 2
        return $this->formatAttributes([
1 ignored issue
show
Coding Style introduced by
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
445 2
            'type' => 'token_count',
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
446 2
            'analyzer' => $fluent->analyzer,
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
447 2
            'enable_position_increments' => $fluent->enable_position_increments,
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
Coding Style introduced by
Variable "enable_position_increments" is not in valid camel caps format
Loading history...
448 2
            'boost' => $fluent->boost,
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
449 2
            'doc_values' => $fluent->doc_values,
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
Coding Style introduced by
Variable "doc_values" is not in valid camel caps format
Loading history...
450 2
            'index' => $fluent->index,
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
451 2
            'null_value' => $fluent->null_value,
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
Coding Style introduced by
Variable "null_value" is not in valid camel caps format
Loading history...
452 2
            'store' => $fluent->store
1 ignored issue
show
Coding Style introduced by
This array key does not seem to be aligned correctly; expected 40 spaces, but found 12.
Loading history...
453
        ]);
0 ignored issues
show
Coding Style introduced by
The closing parenthesis does not seem to be aligned correctly; expected 39 space(s), but found 8.
Loading history...
Coding Style introduced by
For multi-line function calls, the closing parenthesis should be on a new line.

If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
); // Closing parenthesis on a new line.
Loading history...
454
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end compileTokenCount()
Loading history...
455
    
456 36
    private function formatAttributes(array $attributes) : array
0 ignored issues
show
Coding Style introduced by
Private method name "Compiler::formatAttributes" must be prefixed with an underscore
Loading history...
Coding Style introduced by
Missing function doc comment
Loading history...
457
    {
458 36
        return array_filter($attributes);
459
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end formatAttributes()
Loading history...
460
    
461
    /**
462
     * Compile fields
463
     *
464
     * @param array $fields
0 ignored issues
show
Coding Style introduced by
Missing parameter comment
Loading history...
Coding Style introduced by
Tag value indented incorrectly; expected 2 spaces but found 1
Loading history...
465
     * @return array
0 ignored issues
show
Coding Style introduced by
Tag cannot be grouped with parameter tags in a doc comment
Loading history...
466
     */
467 12
    public function compileFields(array $fields) : array
468
    {
469 12
        $statements = [];
470
    
471 12
        foreach ($fields as $field) {
472 12
            if ($field instanceof Fluent && !is_null($field->type)) {
0 ignored issues
show
Coding Style introduced by
There must be a single space after a NOT operator; 0 found
Loading history...
473 12
                $method = 'compile' . ucfirst($this->camelize($field->type));
0 ignored issues
show
Coding Style introduced by
Concat operator must not be surrounded by spaces
Loading history...
474 12
                if (method_exists($this, $method)) {
475 12
                    $statements[$field->name] = (array)$this->$method($field);
476
                }
477
            }
478
        }
479
    
480 12
        return $statements;
481
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 found
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end compileFields()
Loading history...
482
    
483 12
    private function camelize(string $input, string $separator = '_') : string
0 ignored issues
show
Coding Style introduced by
Private method name "Compiler::camelize" must be prefixed with an underscore
Loading history...
Coding Style introduced by
Missing function doc comment
Loading history...
Coding Style introduced by
Incorrect spacing between argument "$separator" and equals sign; expected 0 but found 1
Loading history...
Coding Style introduced by
Incorrect spacing between default value and equals sign for argument "$separator"; expected 0 but found 1
Loading history...
484
    {
485 12
        return str_replace($separator, '', ucwords($input, $separator));
486
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 0 found
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end camelize()
Loading history...
487
}
0 ignored issues
show
Coding Style introduced by
Expected //end class
Loading history...
Coding Style introduced by
As per coding style, files should not end with a newline character.

This check marks files that end in a newline character, i.e. an empy line.

Loading history...
488